mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 06:10:12 +01:00
[ie] Resolve language
to ISO639-2 for ISM formats (#11359)
Closes #11356 Authored by: bashonly
This commit is contained in:
parent
6abef74232
commit
21cdcf03a2
|
@ -47,6 +47,7 @@
|
||||||
FormatSorter,
|
FormatSorter,
|
||||||
GeoRestrictedError,
|
GeoRestrictedError,
|
||||||
GeoUtils,
|
GeoUtils,
|
||||||
|
ISO639Utils,
|
||||||
LenientJSONDecoder,
|
LenientJSONDecoder,
|
||||||
Popen,
|
Popen,
|
||||||
RegexNotFoundError,
|
RegexNotFoundError,
|
||||||
|
@ -3071,7 +3072,11 @@ def _parse_ism_formats_and_subtitles(self, ism_doc, ism_url, ism_id=None):
|
||||||
url_pattern = stream.attrib['Url']
|
url_pattern = stream.attrib['Url']
|
||||||
stream_timescale = int_or_none(stream.get('TimeScale')) or timescale
|
stream_timescale = int_or_none(stream.get('TimeScale')) or timescale
|
||||||
stream_name = stream.get('Name')
|
stream_name = stream.get('Name')
|
||||||
stream_language = stream.get('Language', 'und')
|
# IsmFD expects ISO 639 Set 2 language codes (3-character length)
|
||||||
|
# See: https://github.com/yt-dlp/yt-dlp/issues/11356
|
||||||
|
stream_language = stream.get('Language') or 'und'
|
||||||
|
if len(stream_language) != 3:
|
||||||
|
stream_language = ISO639Utils.short2long(stream_language) or 'und'
|
||||||
for track in stream.findall('QualityLevel'):
|
for track in stream.findall('QualityLevel'):
|
||||||
KNOWN_TAGS = {'255': 'AACL', '65534': 'EC-3'}
|
KNOWN_TAGS = {'255': 'AACL', '65534': 'EC-3'}
|
||||||
fourcc = track.get('FourCC') or KNOWN_TAGS.get(track.get('AudioTag'))
|
fourcc = track.get('FourCC') or KNOWN_TAGS.get(track.get('AudioTag'))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user