diff --git a/youtube_dl/extractor/markiza.py b/youtube_dl/extractor/markiza.py index def960a0c..cf879bc71 100644 --- a/youtube_dl/extractor/markiza.py +++ b/youtube_dl/extractor/markiza.py @@ -4,18 +4,21 @@ from __future__ import unicode_literals import re from .common import InfoExtractor -from ..compat import compat_str from ..utils import ( orderedSet, - parse_duration, + url_or_none, + determine_ext, try_get, + compat_str ) class MarkizaIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?videoarchiv\.markiza\.sk/(?:video/(?:[^/]+/)*|embed/)(?P\d+)(?:[_/]|$)' + _VALID_URL = r'https?://(?:www\.)?videoarchiv\.markiza\.sk/(?:video/(?:[^/]+/)*|embed/)\S+/(?P\d+)(?:[_/-]|$)' + _TESTS = [{ - 'url': 'http://videoarchiv.markiza.sk/video/oteckovia/84723_oteckovia-109', + 'url': 'http://videoarchiv.markiza.sk/video/oteckovia/\ + 84723_oteckovia-109', 'md5': 'ada4e9fad038abeed971843aa028c7b0', 'info_dict': { 'id': '139078', @@ -26,54 +29,104 @@ class MarkizaIE(InfoExtractor): 'duration': 2760, }, }, { - 'url': 'http://videoarchiv.markiza.sk/video/televizne-noviny/televizne-noviny/85430_televizne-noviny', + 'url': 'https://videoarchiv.markiza.sk/video/laska-na-prenajom/epizoda/58779-seria-1-epizoda-14', 'info_dict': { 'id': '85430', 'title': 'Televízne noviny', }, 'playlist_count': 23, }, { - 'url': 'http://videoarchiv.markiza.sk/video/oteckovia/84723', + 'url': 'https://videoarchiv.markiza.sk/video/oteckovia/84723', 'only_matching': True, }, { - 'url': 'http://videoarchiv.markiza.sk/video/84723', + 'url': 'https://videoarchiv.markiza.sk/video/84723', 'only_matching': True, }, { - 'url': 'http://videoarchiv.markiza.sk/video/filmy/85190_kamenak', + 'url': 'https://videoarchiv.markiza.sk/video/filmy/85190_kamenak', 'only_matching': True, }, { - 'url': 'http://videoarchiv.markiza.sk/video/reflex/zo-zakulisia/84651_pribeh-alzbetky', + 'url': 'https://videoarchiv.markiza.sk/video/reflex/zo-zakulisia/84651_pribeh-alzbetky', 'only_matching': True, }, { - 'url': 'http://videoarchiv.markiza.sk/embed/85295', + 'url': 'https://videoarchiv.markiza.sk/embed/85295', 'only_matching': True, }] def _real_extract(self, url): + video_id = self._match_id(url) - data = self._download_json( - 'http://videoarchiv.markiza.sk/json/video_jwplayer7.json', - video_id, query={'id': video_id}) + webpage = self._download_webpage(url, video_id) - info = self._parse_jwplayer_data(data, m3u8_id='hls', mpd_id='dash') + embed = self._search_regex( + r'