From 7b60751e997137f1ce53b94b1a89e9d3dc03c729 Mon Sep 17 00:00:00 2001 From: Jesus E Date: Sun, 28 May 2023 20:47:47 -0400 Subject: Fix failure to detect vp9.2 and mp4v.20.3 codecs --- youtube/yt_data_extract/watch_extraction.py | 7 +++---- 1 file 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) -- cgit v1.2.3