| … | … | @@ -31,7 +31,7 @@ def test_non_manifests_are_left_alone(): |
| 31 | 31 | |
| 32 | 32 | def test_engages_isa_for_a_manifest(): |
| 33 | 33 | item = MagicMock() |
| 34 | | url = set_adaptive_stream(item, {"url": "http://h:7220/a.m3u8?h=auto"}) |
| 34 | url = set_adaptive_stream(item, {"adaptive": True, "url": "http://h:7220/a.m3u8?h=auto"}) |
| 35 | 35 | assert url == "http://h:7220/a.m3u8?h=auto" |
| 36 | 36 | props = dict(c.args for c in item.setProperty.call_args_list) |
| 37 | 37 | assert props["inputstream"] == "inputstream.adaptive" |
| … | … | @@ -41,7 +41,7 @@ def test_engages_isa_for_a_manifest(): |
| 41 | 41 | def test_leaves_other_sources_untouched(): |
| 42 | 42 | """A torrent/debrid/plugin URL must not be handed to ISA.""" |
| 43 | 43 | item = MagicMock() |
| 44 | | assert set_adaptive_stream(item, {"url": "https://h/movie.mkv"}) is None |
| 44 | assert set_adaptive_stream(item, {"adaptive": True, "url": "https://h/movie.mkv"}) is None |
| 45 | 45 | item.setProperty.assert_not_called() |
| 46 | 46 | |
| 47 | 47 | |
| … | … | @@ -51,7 +51,7 @@ def test_strips_the_header_suffix_from_the_played_url(): |
| 51 | 51 | previous attempt fetched the variant playlist bare and took a 403.""" |
| 52 | 52 | item = MagicMock() |
| 53 | 53 | url = set_adaptive_stream( |
| 54 | | item, {"url": "http://h/a.m3u8|Referer=https%3A%2F%2Fvidcore.net%2F"} |
| 54 | item, {"adaptive": True, "url": "http://h/a.m3u8|Referer=https%3A%2F%2Fvidcore.net%2F"} |
| 55 | 55 | ) |
| 56 | 56 | assert url == "http://h/a.m3u8" |
| 57 | 57 | assert "|" not in url |
| … | … | @@ -62,6 +62,7 @@ def test_headers_move_to_isa_properties(): |
| 62 | 62 | set_adaptive_stream( |
| 63 | 63 | item, |
| 64 | 64 | { |
| 65 | "adaptive": True, |
| 65 | 66 | "url": "http://h/a.m3u8", |
| 66 | 67 | "proxyHeaders": {"Referer": "https://vidcore.net/", "User-Agent": "UA/1.0"}, |
| 67 | 68 | }, |
| … | … | @@ -74,7 +75,7 @@ def test_headers_move_to_isa_properties(): |
| 74 | 75 | |
| 75 | 76 | def test_no_header_properties_when_there_are_none(): |
| 76 | 77 | item = MagicMock() |
| 77 | | set_adaptive_stream(item, {"url": "http://h/a.m3u8"}) |
| 78 | set_adaptive_stream(item, {"adaptive": True, "url": "http://h/a.m3u8"}) |
| 78 | 79 | props = dict(c.args for c in item.setProperty.call_args_list) |
| 79 | 80 | assert "inputstream.adaptive.manifest_headers" not in props |
| 80 | 81 | |
| … | … | @@ -85,5 +86,15 @@ def test_mimetype_is_set_per_manifest_kind(): |
| 85 | 86 | ("http://h/a.mpd", "application/dash+xml"), |
| 86 | 87 | ): |
| 87 | 88 | item = MagicMock() |
| 88 | | set_adaptive_stream(item, {"url": url}) |
| 89 | set_adaptive_stream(item, {"adaptive": True, "url": url}) |
| 89 | 90 | item.setMimeType.assert_called_once_with(mime) |
| 91 | |
| 92 | |
| 93 | def test_isa_is_off_unless_a_source_opts_in(): |
| 94 | """Regression, 2026-08-10: engaging ISA for every .m3u8 captured the |
| 95 | single-variant rows too, and ISA stalls the audio on muxed HLS -- the aac |
| 96 | decoder opens and then no sound. Content that plays fine on the bare ffmpeg |
| 97 | demuxer must keep doing so.""" |
| 98 | item = MagicMock() |
| 99 | assert set_adaptive_stream(item, {"url": "http://h/a.m3u8?h=480"}) is None |
| 100 | item.setProperty.assert_not_called() |