From da60a396dd4663e680c07a033997268cf4542bde Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 14 Sep 2025 01:14:01 +0000 Subject: [PATCH] Fix: Prevent KeyError when reusing remote CDMs in dynamic selection Creates a copy of the CDM dictionary before modification to prevent the original configuration from being mutated, allowing the same CDM to be selected multiple times within a session without errors. --- unshackle/commands/dl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unshackle/commands/dl.py b/unshackle/commands/dl.py index 2b130ff..a7e5611 100644 --- a/unshackle/commands/dl.py +++ b/unshackle/commands/dl.py @@ -1630,7 +1630,7 @@ class dl: if not cdm_name: return None - cdm_api = next(iter(x for x in config.remote_cdm if x["name"] == cdm_name), None) + cdm_api = next(iter(x.copy() for x in config.remote_cdm if x["name"] == cdm_name), None) if cdm_api: is_decrypt_lab = True if cdm_api.get("type") == "decrypt_labs" else False if is_decrypt_lab: