From 129dc46b9ea53b4308125564d7818919b05def25 Mon Sep 17 00:00:00 2001 From: Haxy Date: Mon, 6 May 2024 14:41:23 +0100 Subject: [PATCH] Parse YT-EXT-AUDIO-CONTENT-ID for multiple language detection in YouTube HLS Manifests. --- yt_dlp/extractor/common.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index bebbc6b43..9628a876c 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -2211,6 +2211,12 @@ class InfoExtractor: 'quality': quality, 'has_drm': has_drm, } + + # YouTube Specific + if last_stream_inf.get('YT-EXT-AUDIO-CONTENT-ID'): + # Strip anything after and including from the end '.' + f['language'] = last_stream_inf.get('YT-EXT-AUDIO-CONTENT-ID').split('.')[0] + resolution = last_stream_inf.get('RESOLUTION') if resolution: mobj = re.search(r'(?P\d+)[xX](?P\d+)', resolution)