1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-08-15 08:58:28 +00:00
This commit is contained in:
bashonly 2025-08-06 15:36:45 +03:00 committed by GitHub
commit 961239f8f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 29 additions and 25 deletions

View File

@ -1092,7 +1092,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'm4a', 'ext': 'm4a',
'format_id': '318597', 'format_id': '318597',
'format_note': 'DASH audio', 'format_note': 'DASH audio, set 0',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
'vcodec': 'none', 'vcodec': 'none',
@ -1101,7 +1101,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': '318597', 'format_id': '318597',
'format_note': 'DASH video', 'format_note': 'DASH video, set 1',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'none', 'acodec': 'none',
'vcodec': 'avc1.42001f', 'vcodec': 'avc1.42001f',
@ -1112,7 +1112,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': '638590', 'format_id': '638590',
'format_note': 'DASH video', 'format_note': 'DASH video, set 1',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'none', 'acodec': 'none',
'vcodec': 'avc1.42001f', 'vcodec': 'avc1.42001f',
@ -1123,7 +1123,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': '1022565', 'format_id': '1022565',
'format_note': 'DASH video', 'format_note': 'DASH video, set 1',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'none', 'acodec': 'none',
'vcodec': 'avc1.4d001f', 'vcodec': 'avc1.4d001f',
@ -1134,7 +1134,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': '2046506', 'format_id': '2046506',
'format_note': 'DASH video', 'format_note': 'DASH video, set 1',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'none', 'acodec': 'none',
'vcodec': 'avc1.4d001f', 'vcodec': 'avc1.4d001f',
@ -1145,7 +1145,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': '3998017', 'format_id': '3998017',
'format_note': 'DASH video', 'format_note': 'DASH video, set 1',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'none', 'acodec': 'none',
'vcodec': 'avc1.640029', 'vcodec': 'avc1.640029',
@ -1156,7 +1156,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': '5997485', 'format_id': '5997485',
'format_note': 'DASH video', 'format_note': 'DASH video, set 1',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'none', 'acodec': 'none',
'vcodec': 'avc1.640032', 'vcodec': 'avc1.640032',
@ -1174,7 +1174,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': 'h264_aac_144p_m4s', 'format_id': 'h264_aac_144p_m4s',
'format_note': 'DASH video', 'format_note': 'DASH video, set 0',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
'vcodec': 'avc3.42c01e', 'vcodec': 'avc3.42c01e',
@ -1185,7 +1185,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': 'h264_aac_240p_m4s', 'format_id': 'h264_aac_240p_m4s',
'format_note': 'DASH video', 'format_note': 'DASH video, set 0',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
'vcodec': 'avc3.42c01e', 'vcodec': 'avc3.42c01e',
@ -1196,7 +1196,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': 'h264_aac_360p_m4s', 'format_id': 'h264_aac_360p_m4s',
'format_note': 'DASH video', 'format_note': 'DASH video, set 0',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
'vcodec': 'avc3.42c01e', 'vcodec': 'avc3.42c01e',
@ -1207,7 +1207,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': 'h264_aac_480p_m4s', 'format_id': 'h264_aac_480p_m4s',
'format_note': 'DASH video', 'format_note': 'DASH video, set 0',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
'vcodec': 'avc3.42c01e', 'vcodec': 'avc3.42c01e',
@ -1218,7 +1218,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': 'h264_aac_576p_m4s', 'format_id': 'h264_aac_576p_m4s',
'format_note': 'DASH video', 'format_note': 'DASH video, set 0',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
'vcodec': 'avc3.42c01e', 'vcodec': 'avc3.42c01e',
@ -1229,7 +1229,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': 'h264_aac_720p_m4s', 'format_id': 'h264_aac_720p_m4s',
'format_note': 'DASH video', 'format_note': 'DASH video, set 0',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
'vcodec': 'avc3.42c01e', 'vcodec': 'avc3.42c01e',
@ -1240,7 +1240,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'http://unknown/manifest.mpd', 'manifest_url': 'http://unknown/manifest.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': 'h264_aac_1080p_m4s', 'format_id': 'h264_aac_1080p_m4s',
'format_note': 'DASH video', 'format_note': 'DASH video, set 0',
'protocol': 'http_dash_segments', 'protocol': 'http_dash_segments',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
'vcodec': 'avc3.42c01e', 'vcodec': 'avc3.42c01e',
@ -1261,7 +1261,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd', 'manifest_url': 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd',
'ext': 'm4a', 'ext': 'm4a',
'format_id': 'AUDIO-1', 'format_id': 'AUDIO-1',
'format_note': 'DASH audio', 'format_note': 'DASH audio, set 1',
'container': 'm4a_dash', 'container': 'm4a_dash',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
'vcodec': 'none', 'vcodec': 'none',
@ -1273,7 +1273,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd', 'manifest_url': 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': 'VIDEO-2', 'format_id': 'VIDEO-2',
'format_note': 'DASH video', 'format_note': 'DASH video, set 0',
'container': 'mp4_dash', 'container': 'mp4_dash',
'acodec': 'none', 'acodec': 'none',
'vcodec': 'avc1.4d401e', 'vcodec': 'avc1.4d401e',
@ -1286,7 +1286,7 @@ def test_parse_mpd_formats(self):
'manifest_url': 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd', 'manifest_url': 'https://v.redd.it/hw1x7rcg7zl21/DASHPlaylist.mpd',
'ext': 'mp4', 'ext': 'mp4',
'format_id': 'VIDEO-1', 'format_id': 'VIDEO-1',
'format_note': 'DASH video', 'format_note': 'DASH video, set 0',
'container': 'mp4_dash', 'container': 'mp4_dash',
'acodec': 'none', 'acodec': 'none',
'vcodec': 'avc1.4d401e', 'vcodec': 'avc1.4d401e',
@ -1306,7 +1306,7 @@ def test_parse_mpd_formats(self):
'ext': 'm4a', 'ext': 'm4a',
'tbr': 128.001, 'tbr': 128.001,
'asr': 48000, 'asr': 48000,
'format_note': 'DASH audio', 'format_note': 'DASH audio, set 1',
'container': 'm4a_dash', 'container': 'm4a_dash',
'vcodec': 'none', 'vcodec': 'none',
'acodec': 'mp4a.40.2', 'acodec': 'mp4a.40.2',
@ -1323,7 +1323,7 @@ def test_parse_mpd_formats(self):
'width': 336, 'width': 336,
'height': 144, 'height': 144,
'tbr': 100, 'tbr': 100,
'format_note': 'DASH video', 'format_note': 'DASH video, set 3',
'container': 'mp4_dash', 'container': 'mp4_dash',
'vcodec': 'avc1.4D401F', 'vcodec': 'avc1.4D401F',
'acodec': 'none', 'acodec': 'none',
@ -1340,7 +1340,7 @@ def test_parse_mpd_formats(self):
'width': 562, 'width': 562,
'height': 240, 'height': 240,
'tbr': 326, 'tbr': 326,
'format_note': 'DASH video', 'format_note': 'DASH video, set 3',
'container': 'mp4_dash', 'container': 'mp4_dash',
'vcodec': 'avc1.4D401F', 'vcodec': 'avc1.4D401F',
'acodec': 'none', 'acodec': 'none',
@ -1357,7 +1357,7 @@ def test_parse_mpd_formats(self):
'width': 844, 'width': 844,
'height': 360, 'height': 360,
'tbr': 698, 'tbr': 698,
'format_note': 'DASH video', 'format_note': 'DASH video, set 3',
'container': 'mp4_dash', 'container': 'mp4_dash',
'vcodec': 'avc1.4D401F', 'vcodec': 'avc1.4D401F',
'acodec': 'none', 'acodec': 'none',
@ -1374,7 +1374,7 @@ def test_parse_mpd_formats(self):
'width': 1126, 'width': 1126,
'height': 480, 'height': 480,
'tbr': 1493, 'tbr': 1493,
'format_note': 'DASH video', 'format_note': 'DASH video, set 3',
'container': 'mp4_dash', 'container': 'mp4_dash',
'vcodec': 'avc1.4D401F', 'vcodec': 'avc1.4D401F',
'acodec': 'none', 'acodec': 'none',
@ -1391,7 +1391,7 @@ def test_parse_mpd_formats(self):
'width': 1688, 'width': 1688,
'height': 720, 'height': 720,
'tbr': 4482, 'tbr': 4482,
'format_note': 'DASH video', 'format_note': 'DASH video, set 3',
'container': 'mp4_dash', 'container': 'mp4_dash',
'vcodec': 'avc1.4D401F', 'vcodec': 'avc1.4D401F',
'acodec': 'none', 'acodec': 'none',

View File

@ -2952,8 +2952,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)
@ -3017,7 +3018,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,