[generic] extracting mpd manifests properly

unlicense
Lauren Liberda 2021-03-14 00:15:17 +01:00 committed by Dominika
parent c8a9e64511
commit e150971ea7
1 changed files with 3 additions and 1 deletions

View File

@ -2482,13 +2482,15 @@ class GenericIE(InfoExtractor):
# Check for direct link to a video
content_type = head_response.headers.get('Content-Type', '').lower()
m = re.match(r'^(?P<type>audio|video|application(?=/(?:ogg$|(?:vnd\.apple\.|x-)?(?:mpegurl|bittorrent))))/(?P<format_id>[^;\s]+)', content_type)
m = re.match(r'^(?P<type>audio|video|application(?=/(?:ogg$|(?:vnd\.(?:apple|mpeg\.dash)\.|x-)?(?:mpegurl|mpd|bittorrent))))/(?P<format_id>[^;\s]+)', content_type)
if m:
format_id = compat_str(m.group('format_id'))
if format_id.endswith('mpegurl'):
formats = self._extract_m3u8_formats(url, video_id, 'mp4')
elif format_id == 'f4m':
formats = self._extract_f4m_formats(url, video_id)
elif format_id.endswith('mpd'):
formats = self._extract_mpd_formats(url, video_id)
else:
formats = [{
'format_id': format_id,