fix(dash): refuse an encrypted DASH track with no licensable DRM and gate FairPlay-only DASH tracks for a hook service

This commit is contained in:
imSp4rky
2026-12-01 22:05:33 -07:00
parent 992fff3626
commit c7a3febf88
6 changed files with 174 additions and 14 deletions
@@ -164,15 +164,20 @@ def test_best_available_falls_back_to_the_track_that_licenses(
assert ids["video"] == ["1080"]
@pytest.mark.parametrize(("service", "expected"), [(Example, "1080"), (Bridged, "2160")], ids=["no-hook", "hook"])
@pytest.mark.parametrize(
("service", "reason"),
[(Example, "FAKE has no FairPlay bridge hook"), (Bridged, "DASH has no FairPlay bridge")],
ids=["no-hook", "hook"],
)
def test_a_dash_adaptation_set_with_only_a_fairplay_content_protection(
monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture, service: type[Example], expected: str
monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture, service: type[Example], reason: str
) -> None:
source = service(dash=True)
ids = run(monkeypatch, caplog, source)
assert ids["video"] == [expected]
assert ids["video"] == ["1080"]
assert caplog.text.count(f"Left out 1 FairPlay-only track: {reason}") == 1
assert source.session.urls == []