nilaoda/N_m3u8DL-RE · error · FileNotFoundException

ResString.mp4decryptNotFound

Error message

ResString.mp4decryptNotFound

What it means

Startup pre-check in DoWorkAsync: the run requested encrypted-stream decryption (Keys or KeyTextFile given) with DecryptionEngine set to MP4DECRYPT, but the mp4decrypt executable could not be located on PATH (GlobalUtil.FindExecutable returned null) and no usable DecryptionBinaryPath was supplied. The tool aborts before downloading rather than failing mid-decrypt.

Solutions

  1. Install mp4decrypt (from Bento4 toolkit) and make sure it is on PATH
  2. Pass --decryption-binary-path pointing at the mp4decrypt executable
  3. Switch the decryption engine with --use-shaka-packager or rely on the default ffmpeg engine
  4. Check that the file at --decryption-binary-path exists and is executable

Example fix

Install Bento4 so mp4decrypt is on PATH (e.g. apt install mp4decrypt / download Bento4-SDK and add bin/ to PATH), or re-run with: N_m3u8DL-RE ... --decryption-binary-path /usr/local/bin/mp4decrypt
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: User supplies decryption keys (--key/--key-text-file) with the mp4decrypt engine selected while mp4decrypt is neither on PATH nor explicitly given via --decryption-binary-path, or the configured path does not exist.

Common situations: Fresh installs of N_m3u8DL-RE where the Bento4 binaries were never installed; mp4decrypt present only in a folder not on PATH; on Windows the exe not named exactly mp4decrypt.exe; running from a container/CI image without Bento4.


AI-assisted analysis of nilaoda/N_m3u8DL-RE@e113dee70c (2026-09-13). Data as JSON: /api/errors/f8e8858ffd6f36bc. Report an issue: GitHub.

Appendix: source

Thrown at src/N_m3u8DL-RE/Program.cs:171

case DecryptEngine.MP4DECRYPT:
{
    var file = GlobalUtil.FindExecutable("mp4decrypt");
    if (file == null) throw new FileNotFoundException(ResString.mp4decryptNotFound);
    option.DecryptionBinaryPath = file;
    Logger.Extra($"mp4decrypt => {option.DecryptionBinaryPath}");
    break;
}
case DecryptEngine.FFMPEG:
default:
    option.DecryptionBinaryPath = option.FFmpegBinaryPath;
    break;
}
}

View on GitHub (pinned to e113dee70c)