From 42fac496e059414a150fafa828c249357113e868 Mon Sep 17 00:00:00 2001 From: bashonly Date: Fri, 30 May 2025 16:20:23 -0500 Subject: [PATCH 1/2] [utils] `parse_codecs`: Handle IAMF formats Authored by: bashonly --- yt_dlp/utils/_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py index 20aa341ca3..c89f50a51c 100644 --- a/yt_dlp/utils/_utils.py +++ b/yt_dlp/utils/_utils.py @@ -3040,7 +3040,7 @@ def parse_codecs(codecs_str): elif parts[:2] == ['vp9', '2']: hdr = 'HDR10' elif parts[0] in ('flac', 'mp4a', 'opus', 'vorbis', 'mp3', 'aac', 'ac-4', - 'ac-3', 'ec-3', 'eac3', 'dtsc', 'dtse', 'dtsh', 'dtsl'): + 'ac-3', 'ec-3', 'eac3', 'dtsc', 'dtse', 'dtsh', 'dtsl', 'iamf'): acodec = acodec or full_codec elif parts[0] in ('stpp', 'wvtt'): scodec = scodec or full_codec From 9a221819d4289c849dd0244edf88de1ae8b13897 Mon Sep 17 00:00:00 2001 From: bashonly Date: Fri, 30 May 2025 18:37:37 -0500 Subject: [PATCH 2/2] [ie/youtube] Deprioritize IAMF formats Authored by: bashonly --- yt_dlp/extractor/youtube/_video.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index 3d4bdfd56d..afbb34fcfe 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -3477,8 +3477,8 @@ def build_fragments(f): 'width': int_or_none(fmt.get('width')), 'language': join_nonempty(language_code, 'desc' if is_descriptive else '') or None, 'language_preference': PREFERRED_LANG_VALUE if is_original else 5 if is_default else -10 if is_descriptive else -1, - # Strictly de-prioritize damaged and 3gp formats - 'preference': -10 if is_damaged else -2 if itag == '17' else None, + # Strictly de-prioritize damaged, 3gp and iamf formats + 'preference': -10 if is_damaged else -2 if itag in ('17', '773') else None, } mime_mobj = re.match( r'((?:[^/]+)/(?:[^;]+))(?:;\s*codecs="([^"]+)")?', fmt.get('mimeType') or '')