[ie] Consider byte ranges when deduplicating formats (#17923)

Authored by: doe1080
This commit is contained in:
doe1080
2026-12-01 05:42:45 +00:00
committed by GitHub
parent 99629786d9
commit cb97503d92
2 changed files with 31 additions and 6 deletions
+20
View File
@@ -658,6 +658,26 @@ jwplayer("mediaplayer").setup({"abouttext":"Visit Indie DB","aboutlink":"http:\/
}],
})
def test_remove_duplicate_formats(self):
a = {'url': 'https://example.com/a.mp4'}
b = {'url': 'https://example.com/b.mp4'}
expected = [{
'url': 'https://example.com/manifest.mpd',
'fragments': fragments,
} for fragments in (
[a, b],
[{**a, 'byte_range': {'start': 0, 'end': 10}}, b],
[{**a, 'byte_range': {'start': 1, 'end': 10}}, b],
[{**a, 'byte_range': {'start': 0, 'end': 20}}, b],
)]
formats = expected * 2
formats.append({
'url': 'https://example.com/manifest.mpd',
'fragments': [b, a, a],
})
self.ie._remove_duplicate_formats(formats)
self.assertEqual(formats, expected)
def test_parse_m3u8_formats(self):
_TEST_CASES = [
(