From 51d6921eaf3d8606af5d15948d7b5b6d5b8b6a34 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 20 Mar 2026 12:48:49 -0600 Subject: [PATCH] fix(drm): include external KID in PSSH when it differs from existing KIDs When the DASH manifest provides a cenc:default_KID that differs from the PSSH's embedded KIDs, the external KID must be added to the PSSH so the license server returns keys for both. Previously, the PSSH was only modified when all existing KIDs were placeholders, causing a CEKNotFound error when the track's actual encryption KID wasn't in the license response. --- unshackle/core/drm/widevine.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unshackle/core/drm/widevine.py b/unshackle/core/drm/widevine.py index 191bc23..9f3bc2e 100644 --- a/unshackle/core/drm/widevine.py +++ b/unshackle/core/drm/widevine.py @@ -53,6 +53,8 @@ class Widevine: self._kid = kid if pssh.key_ids and all(k in self.PLACEHOLDER_KIDS for k in pssh.key_ids): pssh.set_key_ids([kid]) + elif kid not in (pssh.key_ids or []): + pssh.set_key_ids([*(pssh.key_ids or []), kid]) self._pssh = pssh