From 993025fba6ae59fc245cd782692f4c512c3c7030 Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Thu, 3 Sep 2026 12:33:41 -0600 Subject: [PATCH] fix(dl): fall back to local vaults when the server CDM returns no key --- unshackle/commands/dl.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/unshackle/commands/dl.py b/unshackle/commands/dl.py index 87f88199..3a5de675 100644 --- a/unshackle/commands/dl.py +++ b/unshackle/commands/dl.py @@ -4016,6 +4016,18 @@ class dl: server_cdm = getattr(svc_for_cdm, "_server_cdm", getattr(self, "server_cdm", False)) if server_cdm: + if not cdm_only: + vault_kids = list(getattr(drm, "kids", None) or []) + if track_kid and track_kid not in vault_kids: + vault_kids.append(track_kid) + for kid in vault_kids: + if kid in drm.content_keys: + continue + content_key = self.LICENSE_KEY_CACHE.get(kid) or self.vaults.get_key(kid)[0] + if content_key: + drm.content_keys[kid] = content_key + self.LICENSE_KEY_CACHE[kid] = content_key + if not drm.content_keys: self.log.warning("Server CDM did not resolve any keys for this track") return