subhra74/xdm · error
YoutubeDL executable not found
Error message
YoutubeDL executable not found
What it means
YDLProcess.FindYDLBinary searches known locations and PATH for a youtube-dl or yt-dlp executable (including python-hosted variants). If no candidate binary is found it throws FileNotFoundException with this message. It is called by exec before any ydl operation can run, so it fails fast when the external tool is absent.
Solutions
- Install yt-dlp (e.g. 'pip install yt-dlp' or download yt-dlp.exe) and ensure its location is on PATH.
- Place the yt-dlp/youtube-dl executable in the application's expected binary directory (bundled location checked by FindYDLBinary).
- If installed via pip, confirm the Python Scripts folder is on PATH and 'yt-dlp --version' works in a shell.
- Check antivirus quarantine and whitelist the binary if it was removed.
- Catch FileNotFoundException around ydl operations and prompt the user to install/update the downloader.
Example fix
// before
var info = YDLHelper.GetVideoInfo(url); // FileNotFound if yt-dlp absent
// after
try
{
var info = YDLHelper.GetVideoInfo(url);
}
catch (FileNotFoundException)
{
Console.WriteLine("Install yt-dlp and ensure it is on PATH.");
throw;
} Defensive patterns
Strategy: validation
Validate before calling
static bool YdlAvailable()
{
foreach (var name in new[] { "yt-dlp", "youtube-dl" })
{
var paths = Environment.GetEnvironmentVariable("PATH")
.Split(Path.PathSeparator);
foreach (var dir in paths)
{
var p = Path.Combine(dir, name + (OperatingSystem.IsWindows() ? ".exe" : ""));
if (File.Exists(p)) return true;
}
}
return false;
} Try / catch
try { return YDLProcess.Exec(args); }
catch (FileNotFoundException ex) when (ex.Message == "YoutubeDL executable not found")
{ throw new MissingDependencyException("Install yt-dlp and add it to PATH", ex); } Prevention
- Install yt-dlp on PATH (pip install yt-dlp) before using ydl features
- Bundle yt-dlp with the application where licensing permits
- Check antivirus quarantine if the binary disappears
- Run 'yt-dlp --version' as a startup health check
When it happens
Trigger: Running any youtube-dl-backed operation when neither youtube-dl nor yt-dlp exists in the app's expected directories or on the system PATH — e.g. fresh install without the bundled binary, binary deleted by antivirus, or a minimal environment (server/CI) where the tool was never installed.
Common situations: Fresh machine or Docker image missing yt-dlp; antivirus quarantined youtube-dl.exe; PATH not containing Python Scripts directory for pip-installed yt-dlp; app deployed without bundling the executable; wrong architecture binary that fails discovery.
Understand the failure class
Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.
Related errors
AI-assisted analysis of subhra74/xdm@1ca5a25aae (2026-09-13).
Data as JSON: /api/errors/5c098089d994a322.
Report an issue: GitHub.
Appendix: source
Thrown at app/XDM/XDM.Core/YDLWrapper/YDLProcess.cs:180
{
found = true;
binPath = path;
break;
}
}
path = PlatformHelper.FindExecutableFromSystemPath(executableName);
if (path != null)
{
found = true;
binPath = path;
break;
}
}
if (found)
{
return new YtBinary { BinaryType = GetYtBinaryType(execName!), Path = binPath! };
}
throw new FileNotFoundException("YoutubeDL executable not found");
}
//private void ProcessJson()
//{
// using (StreamReader reader = File.OpenText(@"C:\Users\subhro\Desktop\80a44682-5ea8-4193-bc52-34ee568ce9bb.json"/*JsonOutputFile*/))
// {
// JObject o = (JObject)JToken.ReadFrom(new JsonTextReader(reader));
// o[]
// }
//}
}
}
View on GitHub (pinned to 1ca5a25aae)