aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-08-12 16:48:11 +0700
committerSergey M․ <dstftw@gmail.com>2017-08-12 16:48:11 +0700
commit82889d4ae517640df217f99e7744002e0deba47a (patch)
tree34a8cb7719f8ef55fb5033818ee2a79086f61958 /youtube_dl
parent92a5c415328953851d0a6b7893de5387a1b7b469 (diff)
downloadyoutube-dl-82889d4ae517640df217f99e7744002e0deba47a.tar.xz
[extractor/common] Respect source's type attribute for HTML5 media (closes #13892)
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/common.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 459e7ffd6..4d61275fd 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -2114,9 +2114,9 @@ class InfoExtractor(object):
return f
return {}
- def _media_formats(src, cur_media_type):
+ def _media_formats(src, type_info, cur_media_type):
full_url = absolute_url(src)
- ext = determine_ext(full_url)
+ ext = type_info.get('ext') or determine_ext(full_url)
if ext == 'm3u8':
is_plain_url = False
formats = self._extract_m3u8_formats(
@@ -2165,9 +2165,9 @@ class InfoExtractor(object):
src = source_attributes.get('src')
if not src:
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:
- f = parse_content_type(source_attributes.get('type'))
f.update(formats[0])
media_info['formats'].append(f)
else: