1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-03-09 12:50:23 -05:00

[ie] Fix parsing of MPDs with multiple adaptation sets

Fixes 4ce57d3b87

Authored by: bashonly
This commit is contained in:
bashonly 2025-02-20 23:27:37 -06:00
parent 9c3e8b1696
commit c2d70835bd
No known key found for this signature in database
GPG key ID: 783F096F253D15B0

View file

@ -2792,8 +2792,9 @@ def extract_Initialization(source):
'start_number': 1, 'start_number': 1,
'timescale': 1, 'timescale': 1,
}) })
for adaptation_set in period.findall(_add_ns('AdaptationSet')): for adaptation_idx, adaptation_set in enumerate(period.findall(_add_ns('AdaptationSet'))):
adaption_set_ms_info = extract_multisegment_info(adaptation_set, period_ms_info) adaption_set_ms_info = extract_multisegment_info(adaptation_set, period_ms_info)
adaptation_set_label = try_call(lambda: adaptation_set.find(_add_ns('Label')).text)
for representation in adaptation_set.findall(_add_ns('Representation')): for representation in adaptation_set.findall(_add_ns('Representation')):
representation_attrib = adaptation_set.attrib.copy() representation_attrib = adaptation_set.attrib.copy()
representation_attrib.update(representation.attrib) representation_attrib.update(representation.attrib)
@ -2857,7 +2858,10 @@ def extract_Initialization(source):
'asr': int_or_none(representation_attrib.get('audioSamplingRate')), 'asr': int_or_none(representation_attrib.get('audioSamplingRate')),
'fps': int_or_none(representation_attrib.get('frameRate')), 'fps': int_or_none(representation_attrib.get('frameRate')),
'language': lang if lang not in ('mul', 'und', 'zxx', 'mis') else None, 'language': lang if lang not in ('mul', 'und', 'zxx', 'mis') else None,
'format_note': f'DASH {content_type}', # AdaptationSet ID/index must be included to prevent improper merging as periods
'format_note': join_nonempty(
f'DASH {content_type}', adaptation_set_label,
f'set {adaptation_set.get("id", adaptation_idx)}', delim=', '),
'filesize': filesize, 'filesize': filesize,
'container': mimetype2ext(mime_type) + '_dash', 'container': mimetype2ext(mime_type) + '_dash',
**codecs, **codecs,