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.
This commit is contained in:
Andy
2025-09-14 01:14:01 +00:00
parent a99a391395
commit da60a396dd

View File

@@ -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: