From cee7d9a75f4b4ac8f1d9963564f002a913f3ba0e Mon Sep 17 00:00:00 2001 From: Andy Date: Sun, 15 Feb 2026 13:37:49 -0700 Subject: [PATCH] fix(n_m3u8dl_re): pass all content keys for DualKey DRM decryption --- unshackle/core/downloaders/n_m3u8dl_re.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/unshackle/core/downloaders/n_m3u8dl_re.py b/unshackle/core/downloaders/n_m3u8dl_re.py index d6b7d08..7789d10 100644 --- a/unshackle/core/downloaders/n_m3u8dl_re.py +++ b/unshackle/core/downloaders/n_m3u8dl_re.py @@ -192,8 +192,10 @@ def build_download_args( if ad_keyword: args["--ad-keyword"] = ad_keyword + key_args = [] if content_keys: - args["--key"] = next((f"{kid.hex}:{key.lower()}" for kid, key in content_keys.items()), None) + for kid, key in content_keys.items(): + key_args.extend(["--key", f"{kid.hex}:{key.lower()}"]) decryption_config = config.decryption.lower() engine_name = DECRYPTION_ENGINE.get(decryption_config) or "SHAKA_PACKAGER" @@ -221,6 +223,9 @@ def build_download_args( elif value is not False and value is not None: command.extend([flag, str(value)]) + # Append all content keys (multiple --key flags supported by N_m3u8DL-RE) + command.extend(key_args) + if headers: for key, value in headers.items(): if key.lower() not in ("accept-encoding", "cookie"):