nilaoda/N_m3u8DL-RE · error · ArgumentException
MuxAfterDone disabled, MuxImports not allowed!
Error message
MuxAfterDone disabled, MuxImports not allowed!
What it means
DoWorkAsync validates mutually exclusive CLI options: --mux-import requires --mux-after-done to be enabled, since imported streams are only consumed by the muxer. Providing MuxImports while MuxAfterDone is false throws this ArgumentException at startup.
Solutions
- Add --mux-after-done to the command line
- Or remove the --mux-import arguments if muxing is not wanted
- Check combined CLI/config: some saved config profiles may set MuxImports implicitly
Example fix
// before N_m3u8DL-RE "URL" -M --mux-import "path=subs.ass,lang=eng" // after N_m3u8DL-RE "URL" -M --mux-after-done --mux-import "path=subs.ass,lang=eng"
Defensive patterns
Strategy: validation
Validate before calling
if (args.Contains("--mux-import") && !args.Contains("--mux-after-done"))
throw new ArgumentException("--mux-import requires --mux-after-done"); Type guard
static bool MuxImportsAllowed(CLIOptions o) => o.MuxAfterDone && o.MuxImports.Count > 0 || o.MuxImports.Count == 0;
Prevention
- Always pair --mux-import with --mux-after-done in scripts/templates
- Validate the composed command line before launching long downloads
- When building options programmatically, assert MuxAfterDone == true whenever MuxImports.Count > 0
When it happens
Trigger: Running N_m3u8DL-RE with --mux-import (one or more entries) but without --mux-after-done (or with it explicitly disabled).
Common situations: Users adding subtitle/audio imports assuming they merge automatically, forgetting to enable muxing after download; copied command lines where --mux-after-done was dropped.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- Invalid Speed Limit
- ResString.ffmpegNotFound
- ResString.mkvmergeNotFound
- {DecryptionBinaryPath}
- Mp4 box names must be 4 characters long
AI-assisted analysis of nilaoda/N_m3u8DL-RE@e113dee70c (2026-09-13).
Data as JSON: /api/errors/1c6e745e49837484.
Report an issue: GitHub.
Appendix: source
Thrown at src/N_m3u8DL-RE/Program.cs:115
Logger.InitLogFile();
Logger.LogLevel = option.LogLevel;
Logger.Info(CommandInvoker.VERSION_INFO);
if (option.UseSystemProxy == false)
{
HTTPUtil.HttpClientHandler.UseProxy = false;
}
if (option.CustomProxy != null)
{
HTTPUtil.HttpClientHandler.Proxy = option.CustomProxy;
HTTPUtil.HttpClientHandler.UseProxy = true;
}
// 检查互斥的选项
if (option is { MuxAfterDone: false, MuxImports.Count: > 0 })
{
throw new ArgumentException("MuxAfterDone disabled, MuxImports not allowed!");
}
if (option.UseShakaPackager)
{
option.DecryptionEngine = DecryptEngine.SHAKA_PACKAGER;
}
// LivePipeMux开启时 LiveRealTimeMerge必须开启
if (option is { LivePipeMux: true, LiveRealTimeMerge: false })
{
Logger.WarnMarkUp("LivePipeMux detected, forced enable LiveRealTimeMerge");
option.LiveRealTimeMerge = true;
}
// 预先检查ffmpeg
option.FFmpegBinaryPath ??= GlobalUtil.FindExecutable("ffmpeg");
if (string.IsNullOrEmpty(option.FFmpegBinaryPath) || !File.Exists(option.FFmpegBinaryPath))View on GitHub (pinned to e113dee70c)