{"record":{"id":"59574be348a4d111","repo":"nilaoda/N_m3u8DL-RE","slug":"resstring-shakapackagernotfound","errorCode":null,"errorMessage":"ResString.shakaPackagerNotFound","messagePattern":"ResString\\.shakaPackagerNotFound","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"error","filePath":"src/N_m3u8DL-RE/Program.cs","lineNumber":163,"sourceCode":"            {\n                throw new FileNotFoundException(ResString.mkvmergeNotFound);\n            }\n            Logger.Extra($\"mkvmerge => {option.MkvmergeBinaryPath}\");\n        }\n\n        // 预先检查\n        if (option.Keys is { Length: > 0 } || option.KeyTextFile != null)\n        {\n            if (!string.IsNullOrEmpty(option.DecryptionBinaryPath) && !File.Exists(option.DecryptionBinaryPath))\n            {\n                throw new FileNotFoundException(option.DecryptionBinaryPath);\n            }\n            switch (option.DecryptionEngine)\n            {\n                case DecryptEngine.SHAKA_PACKAGER:\n                {\n                    var file = FindShakaPackager();\n                    if (file == null) throw new FileNotFoundException(ResString.shakaPackagerNotFound);\n                    option.DecryptionBinaryPath = file;\n                    Logger.Extra($\"shaka-packager => {option.DecryptionBinaryPath}\");\n                    break;\n                }\n                case DecryptEngine.MP4DECRYPT:\n                {\n                    var file = GlobalUtil.FindExecutable(\"mp4decrypt\");\n                    if (file == null) throw new FileNotFoundException(ResString.mp4decryptNotFound);\n                    option.DecryptionBinaryPath = file;\n                    Logger.Extra($\"mp4decrypt => {option.DecryptionBinaryPath}\");\n                    break;\n                }\n                case DecryptEngine.FFMPEG:\n                default:\n                    option.DecryptionBinaryPath = option.FFmpegBinaryPath;\n                    break;\n            }\n        }","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/nilaoda/N_m3u8DL-RE/blob/e113dee70c924ee08dae5460624909b04d84cb76/src/N_m3u8DL-RE/Program.cs#L145-L181","documentation":"If the decryption engine is SHAKA_PACKAGER, DoWorkAsync locates the shaka-packager executable via FindShakaPackager(); when it cannot be found it throws FileNotFoundException with the localized 'shaka-packager not found' message. Widevine decryption with the shaka engine cannot proceed without it.","triggerScenarios":"--decryption-engine SHAKA_PACKAGER (or --use-shaka-packager which forces it) combined with content keys, while shaka-packager is absent from PATH and known install locations.","commonSituations":"Users enabling shaka-packager decryption without installing it (it's a separate Python/Node tool); PATH not updated after install; Windows systems where the binary is named shaka-packager.exe but not on PATH.","solutions":["Install shaka-packager and ensure it is on PATH (verify with: shaka-packager --help)","Point the tool at it explicitly via --decryption-binary-path","Switch engines: --decryption-engine MP4DECRYPT with mp4decrypt installed (Bento4)","Remove --use-shaka-packager if decryption is not actually needed"],"exampleFix":"// before\nN_m3u8DL-RE \"URL\" --use-shaka-packager --key KID:KEY\n// after\nN_m3u8DL-RE \"URL\" --decryption-engine MP4DECRYPT --decryption-binary-path /usr/bin/mp4decrypt --key KID:KEY","handlingStrategy":"validation","validationCode":"if (decryptionEngine == DecryptEngine.SHAKA_PACKAGER && FindShakaPackager() == null)\n    throw new FileNotFoundException(\"shaka-packager not installed; install it or use MP4DECRYPT engine\");","typeGuard":"static bool ShakaAvailable() => FindShakaPackager() != null;","tryCatchPattern":"try { await DoWorkAsync(option); }\ncatch (FileNotFoundException ex) when (ex.Message.Contains(\"shakaPackager\") || ex.Message.Contains(\"shaka\"))\n{\n    Console.Error.WriteLine(\"shaka-packager not found: install it or switch to --decryption-engine MP4DECRYPT\");\n}","preventionTips":["Install shaka-packager wherever Widevine decryption with the shaka engine is planned","Prefer MP4DECRYPT (Bento4) if you want a single static binary dependency","Smoke-test decryption on a small stream before batch jobs"],"tags":["csharp","decryption","shaka-packager","dependency"],"backgroundTag":"command-not-found","analyzedSha":"e113dee70c924ee08dae5460624909b04d84cb76","analyzedAt":"2026-09-13T02:43:21.078Z","contentChangedAt":"2026-09-13T02:43:21.078Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}