aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus E <heckyel@riseup.net>2023-05-28 20:47:47 -0400
committerJesus E <heckyel@riseup.net>2023-05-28 20:47:47 -0400
commit7b60751e997137f1ce53b94b1a89e9d3dc03c729 (patch)
tree16e7feda3ddacd4b8426dc6e7611fdefe3f89c35
parent98906170981cc6f1ea757c7974cb43bfd383285d (diff)
downloadyt-local-7b60751e997137f1ce53b94b1a89e9d3dc03c729.tar.lz
yt-local-7b60751e997137f1ce53b94b1a89e9d3dc03c729.tar.xz
yt-local-7b60751e997137f1ce53b94b1a89e9d3dc03c729.zip
Fix failure to detect vp9.2 and mp4v.20.3 codecs
-rw-r--r--youtube/yt_data_extract/watch_extraction.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py
index d8413ea..31127e3 100644
--- a/youtube/yt_data_extract/watch_extraction.py
+++ b/youtube/yt_data_extract/watch_extraction.py
@@ -388,14 +388,13 @@ def _extract_watch_info_desktop(top_level):
return info
def update_format_with_codec_info(fmt, codec):
- if (codec.startswith('av')
- or codec in ('vp9', 'vp8', 'vp8.0', 'h263', 'h264', 'mp4v')):
+ if any(codec.startswith(c) for c in ('av', 'vp', 'h263', 'h264', 'mp4v')):
if codec == 'vp8.0':
codec = 'vp8'
conservative_update(fmt, 'vcodec', codec)
elif (codec.startswith('mp4a')
- or codec in ('opus', 'mp3', 'aac', 'dtse', 'ec-3', 'vorbis')):
- conservative_update(fmt, 'acodec', codec)
+ or codec in ('opus', 'mp3', 'aac', 'dtse', 'ec-3', 'vorbis',
+ 'ac-3')):
else:
print('Warning: unrecognized codec: ' + codec)