-
Notifications
You must be signed in to change notification settings - Fork 2
Feature Release
Complete Fluent Library for yt-dlp in .NET
Version 3 introduces a fully redesigned fluent API with thread-safe command execution, probes, and batch operations.
-
YtdlpBuilder
YtdlpCommand
YtdlpProbe
-
General Options
Network Options
Video Selection Options
Download Options
Filesystem Options
Thumbnail Options
Verbosity & Simulation Options
Workgrounds (headers)
Video Format Options
Subtitle Options
Authentication Options
Post-Processing Options
SponsorBlock Options
-
ExecuteAsync
ExecuteBatchAsync
Events
-
Single video download
Playlist download
Audio extraction
Subtitles & metadata
Probing
Batch downloads with concurrency
Ytdlp.NET v3 is a fully fluent .NET wrapper around yt-dlp, designed to provide:
Thread-safe execution of downloads and probes
Fluent configuration using
YtdlpBuilderComprehensive events for progress, post-processing, and errors
Batch downloads with controlled concurrency
Full coverage of yt-dlp options
v3 is not backward-compatible with v2. The internal configuration is immutable and safe to reuse for multiple commands.
Install via NuGet:
Install-Package Ytdlp.NET -Version 3.0.0
Or in your .csproj:
<PackageReference Include="Ytdlp.NET" Version="3.0.0" />
Key changes:
Feature | v2 | v3 -- | -- | -- Builder | Shared mutable YtdlpOptions | Immutable fluent YtdlpBuilder Thread-safety | None | Thread-safe by design with Interlocked guards Command execution | Single-use | Multi-instance with safe concurrent execution Events | Limited | Full progress, post-processing, and error events Probe | Minimal | Full stdout + stderr capture Options | Simple strings | Strongly-typed methods, full yt-dlp coveragevar command = builder.Build();
command.OnProgressDownload += (s, e) =>
Console.WriteLine($"Progress: {e.Progress}%");
command.OnErrorMessage += (s, msg) =>
Console.WriteLine($"Error: {msg}");
await command.ExecuteAsync("https://youtube.com/watch?v=xyz");
Batch Example:
var urls = new[] { "url1", "url2" };
var results = await command.ExecuteBatchAsync(urls, maxConcurrency: 3);
foreach (var (url, error) in results)
{
Console.WriteLine($"{url} => {(error == null ? "Success" : error.Message)}");
}
var probe = new YtdlpProbe(builder);
var info = await probe.GetInfoAsync("https://youtube.com/watch?v=xyz");
Console.WriteLine(info.Json);
Returns metadata without downloading
Captures stdout + stderr
Thread-safe
Single video download:
var builder = new YtdlpBuilder()
.WithOutputFolder("C:\Videos")
.WithFormat("best");
await builder.Build().ExecuteAsync("https://youtube.com/watch?v=abc123");
Audio extraction:
var builder = new YtdlpBuilder()
.WithOutputFolder("C:\Music")
.WithExtractAudio("mp3", 5);
await builder.Build().ExecuteAsync("https://youtube.com/watch?v=abc123");
Subtitles & Metadata:
var builder = new YtdlpBuilder()
.WriteVideoMetadata()
.WithDownloadSubtitles("en,ja", autoGenerated: true);
await builder.Build().ExecuteAsync("https://youtube.com/watch?v=abc123");
Batch with concurrency:
var urls = new[] { "url1", "url2", "url3" };
var command = builder.Build();
var results = await command.ExecuteBatchAsync(urls, maxConcurrency: 2);
Always use thread-safe builders (
YtdlpBuilder) for multi-command scenariosUse events to track progress and errors instead of polling
Use
ExecuteBatchAsyncfor playlists or multiple downloadsAvoid overwriting files by using
NoFileOverwrites()andNoPostOverwrites()
All yt-dlp errors are propagated as
YtdlpExceptionProbe failures throw
YtdlpExceptionwith stderrCancellation uses
OperationCanceledException
This documentation is full exhaustive v3, ready for GitHub or NuGet.
If you want, I can also generate a fully formatted README.md with clickable table of contents, badges, and live code blocks that you can drop directly into the Ytdlp.NET repo. This would make it production-ready.
Do you want me to do that next?
Copyright (C) 2025-2026 Manojbabu, Manuhub