1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-22 10:11:52 +00:00

[svt] extract dashhbbtv formats(#8867)

This commit is contained in:
remitamine 2016-03-15 19:33:09 +01:00
parent 89807d6a82
commit edfd93518e

View file

@ -19,20 +19,25 @@ class SVTBaseIE(InfoExtractor):
video_info = info['video'] video_info = info['video']
formats = [] formats = []
for vr in video_info['videoReferences']: for vr in video_info['videoReferences']:
player_type = vr.get('playerType')
vurl = vr['url'] vurl = vr['url']
ext = determine_ext(vurl) ext = determine_ext(vurl)
if ext == 'm3u8': if ext == 'm3u8':
formats.extend(self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(
vurl, video_id, vurl, video_id,
ext='mp4', entry_protocol='m3u8_native', ext='mp4', entry_protocol='m3u8_native',
m3u8_id=vr.get('playerType'))) m3u8_id=player_type, fatal=False))
elif ext == 'f4m': elif ext == 'f4m':
formats.extend(self._extract_f4m_formats( formats.extend(self._extract_f4m_formats(
vurl + '?hdcore=3.3.0', video_id, vurl + '?hdcore=3.3.0', video_id,
f4m_id=vr.get('playerType'))) f4m_id=player_type, fatal=False))
elif ext == 'mpd':
if player_type == 'dashhbbtv':
formats.extend(self._extract_mpd_formats(
vurl, video_id, mpd_id=player_type, fatal=False))
else: else:
formats.append({ formats.append({
'format_id': vr.get('playerType'), 'format_id': player_type,
'url': vurl, 'url': vurl,
}) })
self._sort_formats(formats) self._sort_formats(formats)