{"record":{"id":"1c6e745e49837484","repo":"nilaoda/N_m3u8DL-RE","slug":"muxafterdone-disabled-muximports-not-allowed","errorCode":null,"errorMessage":"MuxAfterDone disabled, MuxImports not allowed!","messagePattern":"MuxAfterDone disabled, MuxImports not allowed!","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/N_m3u8DL-RE/Program.cs","lineNumber":115,"sourceCode":"        Logger.InitLogFile();\n        Logger.LogLevel = option.LogLevel;\n        Logger.Info(CommandInvoker.VERSION_INFO);\n\n        if (option.UseSystemProxy == false)\n        {\n            HTTPUtil.HttpClientHandler.UseProxy = false;\n        }\n\n        if (option.CustomProxy != null)\n        {\n            HTTPUtil.HttpClientHandler.Proxy = option.CustomProxy;\n            HTTPUtil.HttpClientHandler.UseProxy = true;\n        }\n\n        // 检查互斥的选项\n        if (option is { MuxAfterDone: false, MuxImports.Count: > 0 })\n        {\n            throw new ArgumentException(\"MuxAfterDone disabled, MuxImports not allowed!\");\n        }\n\n        if (option.UseShakaPackager) \n        {\n            option.DecryptionEngine = DecryptEngine.SHAKA_PACKAGER;\n        }\n\n        // LivePipeMux开启时 LiveRealTimeMerge必须开启\n        if (option is { LivePipeMux: true, LiveRealTimeMerge: false })\n        {\n            Logger.WarnMarkUp(\"LivePipeMux detected, forced enable LiveRealTimeMerge\");\n            option.LiveRealTimeMerge = true;\n        }\n\n        // 预先检查ffmpeg\n        option.FFmpegBinaryPath ??= GlobalUtil.FindExecutable(\"ffmpeg\");\n\n        if (string.IsNullOrEmpty(option.FFmpegBinaryPath) || !File.Exists(option.FFmpegBinaryPath))","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/nilaoda/N_m3u8DL-RE/blob/e113dee70c924ee08dae5460624909b04d84cb76/src/N_m3u8DL-RE/Program.cs#L97-L133","documentation":"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.","triggerScenarios":"Running N_m3u8DL-RE with --mux-import (one or more entries) but without --mux-after-done (or with it explicitly disabled).","commonSituations":"Users adding subtitle/audio imports assuming they merge automatically, forgetting to enable muxing after download; copied command lines where --mux-after-done was dropped.","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"],"exampleFix":"// before\nN_m3u8DL-RE \"URL\" -M --mux-import \"path=subs.ass,lang=eng\"\n// after\nN_m3u8DL-RE \"URL\" -M --mux-after-done --mux-import \"path=subs.ass,lang=eng\"","handlingStrategy":"validation","validationCode":"if (args.Contains(\"--mux-import\") && !args.Contains(\"--mux-after-done\"))\n    throw new ArgumentException(\"--mux-import requires --mux-after-done\");","typeGuard":"static bool MuxImportsAllowed(CLIOptions o) => o.MuxAfterDone && o.MuxImports.Count > 0 || o.MuxImports.Count == 0;","tryCatchPattern":null,"preventionTips":["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"],"tags":["csharp","cli","muxing","argument-validation"],"backgroundTag":"conflicting-config-options","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"}