diff options
author | Yen Chi Hsuan <yan12125@gmail.com> | 2016-01-30 21:42:27 +0800 |
---|---|---|
committer | Yen Chi Hsuan <yan12125@gmail.com> | 2016-01-30 21:42:27 +0800 |
commit | df374b52228e8a083d045f9bc56847e418ef452e (patch) | |
tree | 7577136a6f692b35ac07536044950385b2511544 /youtube_dl/extractor/common.py | |
parent | 5ea1eb78f5e8d9b2ede35504dc3b999f5f89bbaa (diff) |
[common] Prefer the manifest than formats_dict in determining codecs
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 243db71dc..f1313ef04 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -1376,10 +1376,15 @@ class InfoExtractor(object): full_info.update(f) codecs = r.attrib.get('codecs') if codecs: - if full_info.get('acodec') == 'none': - full_info['vcodec'] = codecs - elif full_info.get('vcodec') == 'none': - full_info['acodec'] = codecs + if mime_type.startswith('video/'): + vcodec, acodec = codecs, 'none' + else: # mime_type.startswith('audio/') + vcodec, acodec = 'none', codecs + + full_info.update({ + 'vcodec': vcodec, + 'acodec': acodec, + }) formats.append(full_info) else: existing_format.update(f) |