1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-28 17:40:58 +01:00

[once] check http formats availability

This commit is contained in:
remitamine 2016-03-18 11:50:04 +01:00
parent 0d33166ec5
commit 6187091532

View File

@ -14,13 +14,12 @@ class OnceIE(InfoExtractor):
def _extract_once_formats(self, url): def _extract_once_formats(self, url):
domain_id, application_id, media_item_id = re.match( domain_id, application_id, media_item_id = re.match(
OnceIE._VALID_URL, url).groups() OnceIE._VALID_URL, url).groups()
adaptive_formats = self._extract_m3u8_formats( formats = self._extract_m3u8_formats(
self.ADAPTIVE_URL_TEMPLATE % ( self.ADAPTIVE_URL_TEMPLATE % (
domain_id, application_id, media_item_id), domain_id, application_id, media_item_id),
media_item_id, 'mp4', m3u8_id='hls', fatal=False) media_item_id, 'mp4', m3u8_id='hls', fatal=False)
formats = [] progressive_formats = []
formats.extend(adaptive_formats) for adaptive_format in formats:
for adaptive_format in adaptive_formats:
rendition_id = self._search_regex( rendition_id = self._search_regex(
r'/now/media/playlist/[^/]+/[^/]+/([^/]+)', r'/now/media/playlist/[^/]+/[^/]+/([^/]+)',
adaptive_format['url'], 'redition id', default=None) adaptive_format['url'], 'redition id', default=None)
@ -33,5 +32,7 @@ class OnceIE(InfoExtractor):
'hls', 'http'), 'hls', 'http'),
'protocol': 'http', 'protocol': 'http',
}) })
formats.append(progressive_format) progressive_formats.append(progressive_format)
self._check_formats(progressive_formats, media_item_id)
formats.extend(progressive_formats)
return formats return formats