YoutubeDLSharp 1.0.0-beta5

.NET 6.0 .NET Standard 2.0 .NET Framework 4.5
This is a prerelease version of YoutubeDLSharp.
There is a newer version of this package available.
See the version list below for details.
dotnet add package YoutubeDLSharp --version 1.0.0-beta5
NuGet\Install-Package YoutubeDLSharp -Version 1.0.0-beta5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="YoutubeDLSharp" Version="1.0.0-beta5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YoutubeDLSharp --version 1.0.0-beta5
#r "nuget: YoutubeDLSharp, 1.0.0-beta5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install YoutubeDLSharp as a Cake Addin
#addin nuget:?package=YoutubeDLSharp&version=1.0.0-beta5&prerelease

// Install YoutubeDLSharp as a Cake Tool
#tool nuget:?package=YoutubeDLSharp&version=1.0.0-beta5&prerelease


Build status

A simple .NET wrapper library for youtube-dl and yt-dlp.

For yt-dlp For youtube-dl
Versions >= v.1.0 Versions v.0.x
Nuget NuGet

What is it?

YoutubeDLSharp is a wrapper for the popular command-line video downloaders youtube-dl and yt-dlp. It allows you to use the extensive features of youtube-dl/ yt-dlp in a .NET project. For more about the features of youtube-dl/ yt-dlp, supported websites and anything else, visit their project pages at and

How do I install it?

First, add the package from NuGet:

PM> Install-Package YoutubeDLSharp

Next, you would want to have the binaries for yt-dlp and FFmpeg available. If you don't have them set up already, you can either...

  • them from their respective download pages manually: [yt-dlp Download] [FFmpeg Download]
  • ...use the built-in download methods:
    using YoutubeDLSharp;
    await YoutubeDL.DownloadYtDlpBinary();
    await YoutubeDL.DownloadFFmpegBinary();

How do I use it?

There are two ways to use YoutubeDLSharp: the class YoutubeDL provides high level methods for downloading and converting videos while the class YoutubeDLProcess allows directer and flexibler access to the youtube-dl process.

Convenient Approach

In the simplest case, initializing the downloader and downloading a video can be achieved like this:

var ytdl = new YoutubeDL();
// set the path of yt-dlp and FFmpeg if they're not in PATH or current directory
ytdl.YoutubeDLPath = "path\\to\\yt-dlp.exe";
ytdl.FFmpegPath = "path\\to\\ffmpeg.exe";
// optional: set a different download folder
ytdl.OutputFolder = "some\\directory\\for\\video\\downloads";
// download a video
var res = await ytdl.RunVideoDownload("");
// the path of the downloaded file
string path = res.Data;

Instead of only downloading a video, you can also directly extract the audio track ...

var res = await ytdl.RunAudioDownload(

... or selectively download videos from a playlist:

var res = await ytdl.RunVideoPlaylistDownload(
    start: 52, end: 76

All of the above methods also allow you to track the download progress or cancel an ongoing download:

// a progress handler with a callback that updates a progress bar
var progress = new Progress<DownloadProgress>(p => progressBar.Value = p.Progress);
// a cancellation token source used for cancelling the download
// use `cts.Cancel();` to perform cancellation
var cts = new CancellationTokenSource();
// ...
await ytdl.RunVideoDownload("",
                            progress: progress, ct: cts.Token);

As youtube-dl also allows you to extract extensive metadata for videos, you can also fetch these (without downloading the video):

var res = await ytdl.RunVideoDataFetch("");
// get some video information
VideoData video = res.Data;
string title = video.Title;
string uploader = video.Uploader;
long? views = video.ViewCount;
// all available download formats
FormatData[] formats = video.Formats;
// ...

This intro does not show all available options. Refer to the method documentations for more.

The project includes a demo WPF desktop app under WpfDemoApp that uses the YoutubeDL class.

Advanced Usage

Working with options

YoutubeDLSharp uses the OptionSet class to model youtube-dl/ yt-dlp options. The names of the option properties correspond to the names of youtube-dl, so defining a set of options can look like this:

var options = new OptionSet()
    NoContinue = true,
    RestrictFilenames = true,
    Format = "best",
    RecodeVideo = VideoRecodeFormat.Mp4,
    Exec = "echo {}"

Some options of yt-dlp can be set multiple times. This is reflected in YoutubeDLSharp by passing an array of values to the corresponding option properties:

var options = new OptionSet()
    PostprocessorArgs = new[]
        "ffmpeg:-vcodec h264_nvenc",
        "ffmpeg_i1:-hwaccel cuda -hwaccel_output_format cuda"

For documentation of all options supported by yt-dlp and their effects, visit

Additionally, YoutubeDLSharp allows you to pass custom options to the downloader program. This is especially useful when a forked/ modified version of youtube-dl is used. Custom can be specified like this:

// add
options.AddCustomOption<string>("--my-custom-option", "value");
// set
options.SetCustomOption<string>("--my-custom-option", "new value");

To run a youtube-dl process with the defined options, you can use the YoutubeDLProcess class:

var ytdlProc = new YoutubeDLProcess();
// capture the standard output and error output
ytdlProc.OutputReceived += (o, e) => Console.WriteLine(e.Data);
ytdlProc.ErrorReceived += (o, e) => Console.WriteLine("ERROR: " + e.Data);
// start running
string[] urls = new[] { "" };
await ytdlProc.RunAsync(urls, options);
Loading/ Saving configuration

You can persist a youtube-dl/ yt-dlp configuration to a file and reload it:

// Save to file
var saveOptions = new OptionSet();

// Reload configuration
OptionSet loadOptions = OptionSet.LoadConfigFile("path\\to\\file");

The file format is compatible with the format used by youtube-dl/ yt-dlp itself. For more, read

Issues & Contributing

You are very welcome to contribute by reporting issues, fixing bugs or resolving inconsistencies to youtube-dl/ yt-dlp. If you want to contribute a new feature to the library, please open an issue with your suggestion before starting to implement it.

All issues related to downloading specific videos, support for websites or downloading/ conversion features should better be reported to

Version History

See Changelog.


This project is licensed under BSD-3-Clause license.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on YoutubeDLSharp:

Package Downloads

Package Description

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on YoutubeDLSharp:

Repository Stars
Modern Windows GUI for youtube-dl/ yt-dlp
Version Downloads Last updated
1.0.0 774 7/1/2023
1.0.0-beta6 476 4/8/2023
1.0.0-beta5 111 4/2/2023
1.0.0-beta4 393 3/5/2023
1.0.0-beta3 530 1/17/2023
1.0.0-beta2 139 12/28/2022
1.0.0-beta 180 10/31/2022
0.4.3 3,001 11/20/2022
0.4.2 1,399 3/12/2022
0.4.1 826 1/18/2022
0.4.0 699 10/11/2021
0.3.1 1,866 6/6/2021
0.3.0 1,154 9/27/2020
0.2.1 557 5/2/2020
0.2.0 447 3/22/2020
0.1.0 570 1/12/2020