1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-02 17:22:31 +01:00

[fivetv] relax video URL regex and support https URLs

This commit is contained in:
Remita Amine 2019-07-11 23:09:09 +01:00
parent 27019dbb4b
commit 0dd58a523f

View File

@ -9,7 +9,7 @@
class FiveTVIE(InfoExtractor): class FiveTVIE(InfoExtractor):
_VALID_URL = r'''(?x) _VALID_URL = r'''(?x)
http:// https?://
(?:www\.)?5-tv\.ru/ (?:www\.)?5-tv\.ru/
(?: (?:
(?:[^/]+/)+(?P<id>\d+)| (?:[^/]+/)+(?P<id>\d+)|
@ -39,6 +39,7 @@ class FiveTVIE(InfoExtractor):
'duration': 180, 'duration': 180,
}, },
}, { }, {
# redirect to https://www.5-tv.ru/projects/1000095/izvestia-glavnoe/
'url': 'http://www.5-tv.ru/glavnoe/#itemDetails', 'url': 'http://www.5-tv.ru/glavnoe/#itemDetails',
'info_dict': { 'info_dict': {
'id': 'glavnoe', 'id': 'glavnoe',
@ -46,6 +47,7 @@ class FiveTVIE(InfoExtractor):
'title': r're:^Итоги недели с \d+ по \d+ \w+ \d{4} года$', 'title': r're:^Итоги недели с \d+ по \d+ \w+ \d{4} года$',
'thumbnail': r're:^https?://.*\.jpg$', 'thumbnail': r're:^https?://.*\.jpg$',
}, },
'skip': 'redirect to «Известия. Главное» project page',
}, { }, {
'url': 'http://www.5-tv.ru/glavnoe/broadcasts/508645/', 'url': 'http://www.5-tv.ru/glavnoe/broadcasts/508645/',
'only_matching': True, 'only_matching': True,
@ -70,7 +72,7 @@ def _real_extract(self, url):
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
video_url = self._search_regex( video_url = self._search_regex(
[r'<div[^>]+?class="flowplayer[^>]+?data-href="([^"]+)"', [r'<div[^>]+?class="(?:flow)?player[^>]+?data-href="([^"]+)"',
r'<a[^>]+?href="([^"]+)"[^>]+?class="videoplayer"'], r'<a[^>]+?href="([^"]+)"[^>]+?class="videoplayer"'],
webpage, 'video url') webpage, 'video url')