Skip to content

Commit

Permalink
Fix failure to detect vp9.2 and mp4v.20.3 codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
user234683 committed Nov 28, 2022
1 parent 0e383cd commit 8dae47d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions youtube/yt_data_extract/watch_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,13 +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')):
or codec in ('opus', 'mp3', 'aac', 'dtse', 'ec-3', 'vorbis',
'ac-3')):
conservative_update(fmt, 'acodec', codec)
else:
print('Warning: unrecognized codec: ' + codec)
Expand Down

0 comments on commit 8dae47d

Please sign in to comment.