[brightcove] skip ism manifests

This commit is contained in:
Remita Amine 2016-07-14 14:13:57 +01:00
parent 233b58dec7
commit e910fe2fe4
2 changed files with 8 additions and 4 deletions

View File

@ -27,6 +27,7 @@
unsmuggle_url, unsmuggle_url,
update_url_query, update_url_query,
clean_html, clean_html,
mimetype2ext,
) )
@ -545,14 +546,16 @@ def _real_extract(self, url):
formats = [] formats = []
for source in json_data.get('sources', []): for source in json_data.get('sources', []):
container = source.get('container') container = source.get('container')
source_type = source.get('type') ext = mimetype2ext(source.get('type'))
src = source.get('src') src = source.get('src')
if source_type == 'application/x-mpegURL' or container == 'M2TS': if ext == 'ism':
continue
elif ext == 'm3u8' or container == 'M2TS':
if not src: if not src:
continue continue
formats.extend(self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(
src, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False)) src, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False))
elif source_type == 'application/dash+xml': elif ext == 'mpd':
if not src: if not src:
continue continue
formats.extend(self._extract_mpd_formats(src, video_id, 'dash', fatal=False)) formats.extend(self._extract_mpd_formats(src, video_id, 'dash', fatal=False))
@ -568,7 +571,7 @@ def _real_extract(self, url):
'tbr': tbr, 'tbr': tbr,
'filesize': int_or_none(source.get('size')), 'filesize': int_or_none(source.get('size')),
'container': container, 'container': container,
'ext': container.lower(), 'ext': ext or container.lower(),
} }
if width == 0 and height == 0: if width == 0 and height == 0:
f.update({ f.update({

View File

@ -2123,6 +2123,7 @@ def mimetype2ext(mt):
'dash+xml': 'mpd', 'dash+xml': 'mpd',
'f4m': 'f4m', 'f4m': 'f4m',
'f4m+xml': 'f4m', 'f4m+xml': 'f4m',
'vnd.ms-sstr+xml': 'ism',
}.get(res, res) }.get(res, res)