From f4544b4a70d3f40f09de9f74598af48920f2833c Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Tue, 26 May 2026 14:04:06 -0600 Subject: [PATCH] fix(hls): resolve per-rendition KID in no-EXT-X-KEY fallback Manifests that signal DRM only via EXT-X-SESSION-DATA share one session_drm across all renditions, carrying just the manifest-level KID. The fallback licensing path licensed without the track's real KID, so --vaults-only only looked up the shared KID and could not find the rendition's key even when the vault held it (--cdm-only masked this since the license returns all keys). Resolve the KID from the init segment's tenc box and pass it through, matching the EXT-X-KEY path. --- unshackle/core/manifests/hls.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unshackle/core/manifests/hls.py b/unshackle/core/manifests/hls.py index b26185a..a953659 100644 --- a/unshackle/core/manifests/hls.py +++ b/unshackle/core/manifests/hls.py @@ -609,8 +609,9 @@ class HLS: try: if not license_widevine: raise ValueError("license_widevine func must be supplied to use DRM") + track_kid = HLS.get_track_kid_from_init(master, track, session) or session_drm.kid progress(downloaded="LICENSING") - license_widevine(session_drm) + license_widevine(session_drm, track_kid=track_kid) progress(downloaded="[yellow]LICENSED") except Exception: # noqa DOWNLOAD_CANCELLED.set() # skip pending track downloads