mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-09 09:19:45 +01:00
[extractor/common] Respect source's type attribute for HTML5 media (closes #13892)
This commit is contained in:
parent
92a5c41532
commit
82889d4ae5
@ -2114,9 +2114,9 @@ def parse_content_type(content_type):
|
|||||||
return f
|
return f
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def _media_formats(src, cur_media_type):
|
def _media_formats(src, type_info, cur_media_type):
|
||||||
full_url = absolute_url(src)
|
full_url = absolute_url(src)
|
||||||
ext = determine_ext(full_url)
|
ext = type_info.get('ext') or determine_ext(full_url)
|
||||||
if ext == 'm3u8':
|
if ext == 'm3u8':
|
||||||
is_plain_url = False
|
is_plain_url = False
|
||||||
formats = self._extract_m3u8_formats(
|
formats = self._extract_m3u8_formats(
|
||||||
@ -2165,9 +2165,9 @@ def _media_formats(src, cur_media_type):
|
|||||||
src = source_attributes.get('src')
|
src = source_attributes.get('src')
|
||||||
if not src:
|
if not src:
|
||||||
continue
|
continue
|
||||||
is_plain_url, formats = _media_formats(src, media_type)
|
f = parse_content_type(source_attributes.get('type'))
|
||||||
|
is_plain_url, formats = _media_formats(src, f, media_type)
|
||||||
if is_plain_url:
|
if is_plain_url:
|
||||||
f = parse_content_type(source_attributes.get('type'))
|
|
||||||
f.update(formats[0])
|
f.update(formats[0])
|
||||||
media_info['formats'].append(f)
|
media_info['formats'].append(f)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user