aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/onet.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-02-15 01:14:06 +0700
committerSergey M․ <dstftw@gmail.com>2017-02-15 01:14:06 +0700
commit43a3d9edfcdad8eb33758c4a7f4f912322001b8a (patch)
treead27a0011448f89d40195431c9c193e16074dce1 /youtube_dl/extractor/onet.py
parentd31aa74fdb3f69071ba869feba03525f67e974f0 (diff)
[onetpl] Add support for onet.pl (closes #10507)
Diffstat (limited to 'youtube_dl/extractor/onet.py')
-rw-r--r--youtube_dl/extractor/onet.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/youtube_dl/extractor/onet.py b/youtube_dl/extractor/onet.py
index 46bad492a..801aadbff 100644
--- a/youtube_dl/extractor/onet.py
+++ b/youtube_dl/extractor/onet.py
@@ -181,3 +181,35 @@ class OnetChannelIE(OnetBaseIE):
channel_title = strip_or_none(get_element_by_class('o_channelName', webpage))
channel_description = strip_or_none(get_element_by_class('o_channelDesc', webpage))
return self.playlist_result(entries, channel_id, channel_title, channel_description)
+
+
+class OnetPlIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:[^/]+\.)?onet\.pl/(?:[^/]+/)+(?P<id>[0-9a-z]+)'
+ IE_NAME = 'onet.pl'
+
+ _TESTS = [{
+ 'url': 'http://eurosport.onet.pl/zimowe/skoki-narciarskie/ziobro-wygral-kwalifikacje-w-pjongczangu/9ckrly',
+ 'md5': 'b94021eb56214c3969380388b6e73cb0',
+ 'info_dict': {
+ 'id': '1561707.1685479',
+ 'ext': 'mp4',
+ 'title': 'Ziobro wygrał kwalifikacje w Pjongczangu',
+ 'description': 'md5:61fb0740084d2d702ea96512a03585b4',
+ 'upload_date': '20170214',
+ 'timestamp': 1487078046,
+ },
+ }, {
+ 'url': 'http://film.onet.pl/zwiastuny/ghost-in-the-shell-drugi-zwiastun-pl/5q6yl3',
+ 'only_matching': True,
+ }]
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+
+ webpage = self._download_webpage(url, video_id)
+
+ mvp_id = self._search_regex(
+ r'data-params-mvp=["\'](\d+\.\d+)', webpage, 'mvp id')
+
+ return self.url_result(
+ 'onetmvp:%s' % mvp_id, OnetMVPIE.ie_key(), video_id=mvp_id)