From a7b8467ac0baecd02a815b1f57731ae9bb10ab87 Mon Sep 17 00:00:00 2001 From: Vitaliy Syrchikov Date: Fri, 15 May 2015 16:52:11 +0400 Subject: [PATCH 1/3] Sportbox extractor fix. --- youtube_dl/extractor/sportbox.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/sportbox.py b/youtube_dl/extractor/sportbox.py index becdf658f6..8302205438 100644 --- a/youtube_dl/extractor/sportbox.py +++ b/youtube_dl/extractor/sportbox.py @@ -11,7 +11,7 @@ class SportBoxIE(InfoExtractor): - _VALID_URL = r'https?://news\.sportbox\.ru/Vidy_sporta/(?:[^/]+/)+spbvideo_NI\d+_(?P.+)' + _VALID_URL = r'https?://news\.sportbox\.ru/(?:[^/]+/)+spbvideo_NI\d+_(?P.+)' _TESTS = [ { 'url': 'http://news.sportbox.ru/Vidy_sporta/Avtosport/Rossijskij/spbvideo_NI483529_Gonka-2-zaezd-Obyedinenniy-2000-klassi-Turing-i-S', @@ -50,7 +50,7 @@ def _real_extract(self, url): display_id, 'Downloading player webpage') hls = self._search_regex( - r"var\s+original_hls_file\s*=\s*'([^']+)'", player, 'hls file') + r"sportboxPlayer\.jwplayer_common_params\.file\s*=\s*['\"]+([^\"]+)['\"]+", player, 'hls file') formats = self._extract_m3u8_formats(hls, display_id, 'mp4') From ae670a6ed8019f1b69bbe345621f51c8b32789ec Mon Sep 17 00:00:00 2001 From: Vitaliy Syrchikov Date: Fri, 15 May 2015 17:53:05 +0400 Subject: [PATCH 2/3] Sportbox source fix. HD videos support. --- youtube_dl/extractor/sportbox.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/sportbox.py b/youtube_dl/extractor/sportbox.py index 8302205438..695b3ff825 100644 --- a/youtube_dl/extractor/sportbox.py +++ b/youtube_dl/extractor/sportbox.py @@ -14,7 +14,7 @@ class SportBoxIE(InfoExtractor): _VALID_URL = r'https?://news\.sportbox\.ru/(?:[^/]+/)+spbvideo_NI\d+_(?P.+)' _TESTS = [ { - 'url': 'http://news.sportbox.ru/Vidy_sporta/Avtosport/Rossijskij/spbvideo_NI483529_Gonka-2-zaezd-Obyedinenniy-2000-klassi-Turing-i-S', + 'url': 'http://news.sportbox.ru/Vidy_sporta/Avtosport/Rossijskij/spbvideo_NI483529_Gonka-2-zaezd-Obyedinenniy-2000-klassi-Turing-i-S', 'md5': 'ff56a598c2cf411a9a38a69709e97079', 'info_dict': { 'id': '80822', @@ -42,11 +42,15 @@ def _real_extract(self, url): webpage = self._download_webpage(url, display_id) - video_id = self._search_regex( - r'src="/vdl/player/media/(\d+)"', webpage, 'video id') + sobj = re.search(r'src="/vdl/player/(?P\w+)/(?P\d+)"', webpage) + if (sobj): + video_id = sobj.group('video_id') + media_type = sobj.group('media_type') + else: + raise RegexNotFoundError('Unable to extract video_id') player = self._download_webpage( - 'http://news.sportbox.ru/vdl/player/media/%s' % video_id, + 'http://news.sportbox.ru/vdl/player/%s/%s' % (media_type, video_id), display_id, 'Downloading player webpage') hls = self._search_regex( From e9ca615a9872e85a6986061fdf54257244ce1f77 Mon Sep 17 00:00:00 2001 From: Vitaliy Syrchikov Date: Fri, 15 May 2015 19:57:54 +0400 Subject: [PATCH 3/3] New test --- youtube_dl/extractor/sportbox.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/sportbox.py b/youtube_dl/extractor/sportbox.py index 695b3ff825..cb1515eff4 100644 --- a/youtube_dl/extractor/sportbox.py +++ b/youtube_dl/extractor/sportbox.py @@ -30,10 +30,29 @@ class SportBoxIE(InfoExtractor): # m3u8 download 'skip_download': True, }, - }, { + }, + { + 'url': 'http://news.sportbox.ru/video/no_ads/spbvideo_NI536574_V_Novorossijske_proshel_detskij_turnir_Pole_slavy_bojevoj?ci=211355', + 'md5': 'ff56a598c2cf411a9a38a69709e97079', + 'info_dict': { + 'id': '211355', + 'ext': 'mp4', + 'title': 'В Новороссийске прошел детский турнир «Поле славы боевой»', + 'description': '16 детских коллективов приняли участие в суперфинале турнира «Поле славы боевой».', + 'thumbnail': 're:^https?://.*\.jpg$', + 'timestamp': 1426237001, + 'upload_date': '20150313', + 'duration': 292, + }, + 'params': { + # m3u8 download + 'skip_download': True, + }, + }, + { 'url': 'http://news.sportbox.ru/Vidy_sporta/billiard/spbvideo_NI486287_CHempionat-mira-po-dinamichnoy-piramide-4', 'only_matching': True, - } + }, ] def _real_extract(self, url):