From fbc4aa2c4d3b3b5908e9a2f27f080c5aada41759 Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Sun, 26 Apr 2026 16:33:16 -0600 Subject: [PATCH] fix(drm): pass per-segment PSSH to PlayReady license callback HLS manifests with per-segment EXT-X-KEY changes generate distinct WRMHEADERs per segment. Service license callbacks that build the license URI from cached track-level PSSH state can mismatch the challenge KID, causing the license server to omit it and triggering CEKNotFound. Forward pssh_b64 from the active DRM and fall back to the legacy single-arg call when a service hasn't adopted the kwarg. --- unshackle/core/drm/playready.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unshackle/core/drm/playready.py b/unshackle/core/drm/playready.py index cbf4a96..bc9a713 100644 --- a/unshackle/core/drm/playready.py +++ b/unshackle/core/drm/playready.py @@ -295,7 +295,10 @@ class PlayReady: if challenge: try: - license_res = licence(challenge=challenge) + try: + license_res = licence(challenge=challenge, pssh_b64=self.pssh_b64) + except TypeError: + license_res = licence(challenge=challenge) if isinstance(license_res, bytes): license_str = license_res.decode(errors="ignore") else: