[tvp:embed] handling formats better way

This commit is contained in:
Lauren Liberda 2021-04-22 15:49:51 +02:00 committed by Dominika
parent ef77f34b31
commit 15beff25c0

View file

@ -389,7 +389,7 @@ class TVPEmbedIE(InfoExtractor):
for file in content['files']: for file in content['files']:
video_url = file['url'] video_url = file['url']
if video_url.endswith('.m3u8'): if video_url.endswith('.m3u8'):
formats.extend(self._extract_m3u8_formats(video_url, video_id, m3u8_id='hls')) formats.extend(self._extract_m3u8_formats(video_url, video_id, m3u8_id='hls', ext='mp4'))
elif video_url.endswith('.mpd'): elif video_url.endswith('.mpd'):
formats.extend(self._extract_mpd_formats(video_url, video_id, mpd_id='dash')) formats.extend(self._extract_mpd_formats(video_url, video_id, mpd_id='dash'))
elif video_url.endswith('.f4m'): elif video_url.endswith('.f4m'):
@ -397,12 +397,12 @@ class TVPEmbedIE(InfoExtractor):
elif video_url.endswith('.ism/manifest'): elif video_url.endswith('.ism/manifest'):
formats.extend(self._extract_ism_formats(video_url, video_id, ism_id='mss')) formats.extend(self._extract_ism_formats(video_url, video_id, ism_id='mss'))
else: else:
# probably just mp4 versions # mp4, wmv or something
quality = file.get('quality', {}) quality = file.get('quality', {})
formats.append({ formats.append({
'format_id': 'direct', 'format_id': 'direct',
'url': video_url, 'url': video_url,
'ext': determine_ext(video_url, 'mp4'), 'ext': determine_ext(video_url, file['type']),
'fps': int_or_none(quality.get('fps')), 'fps': int_or_none(quality.get('fps')),
'tbr': int_or_none(quality.get('bitrate')), 'tbr': int_or_none(quality.get('bitrate')),
'width': int_or_none(quality.get('width')), 'width': int_or_none(quality.get('width')),