aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2019-06-14 01:56:17 +0700
committerSergey M․ <dstftw@gmail.com>2019-06-14 01:56:17 +0700
commit28cc2241e44ff0c0704cfffaca6d47d377041aa5 (patch)
tree25809e15d487f1de2eef39fbaa94f83ae9e9bb67 /youtube_dl/utils.py
parent8361e7f93489f226542517216b2127ff170ca996 (diff)
[utils] Restrict parse_codecs and add theora as known vcodec (#21381)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index ead9bd862..a1f586b80 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -2529,7 +2529,7 @@ def parse_codecs(codecs_str):
vcodec, acodec = None, None
for full_codec in splited_codecs:
codec = full_codec.split('.')[0]
- if codec in ('avc1', 'avc2', 'avc3', 'avc4', 'vp9', 'vp8', 'hev1', 'hev2', 'h263', 'h264', 'mp4v', 'hvc1', 'av01'):
+ if codec in ('avc1', 'avc2', 'avc3', 'avc4', 'vp9', 'vp8', 'hev1', 'hev2', 'h263', 'h264', 'mp4v', 'hvc1', 'av01', 'theora'):
if not vcodec:
vcodec = full_codec
elif codec in ('mp4a', 'opus', 'vorbis', 'mp3', 'aac', 'ac-3', 'ec-3', 'eac3', 'dtsc', 'dtse', 'dtsh', 'dtsl'):
@@ -2540,13 +2540,8 @@ def parse_codecs(codecs_str):
if not vcodec and not acodec:
if len(splited_codecs) == 2:
return {
- 'vcodec': vcodec,
- 'acodec': acodec,
- }
- elif len(splited_codecs) == 1:
- return {
- 'vcodec': 'none',
- 'acodec': vcodec,
+ 'vcodec': splited_codecs[0],
+ 'acodec': splited_codecs[1],
}
else:
return {