Parse YT-EXT-AUDIO-CONTENT-ID for multiple language detection in YouTube HLS Manifests.

pull/9875/head
Haxy 2024-05-06 14:41:23 +01:00
rodzic 5904853ae5
commit 129dc46b9e
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -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<width>\d+)[xX](?P<height>\d+)', resolution)