YoutubeExplode.Converter
6.2.10
See the version list below for details.
dotnet add package YoutubeExplode.Converter --version 6.2.10
NuGet\Install-Package YoutubeExplode.Converter -Version 6.2.10
<PackageReference Include="YoutubeExplode.Converter" Version="6.2.10" />
paket add YoutubeExplode.Converter --version 6.2.10
#r "nuget: YoutubeExplode.Converter, 6.2.10"
// Install YoutubeExplode.Converter as a Cake Addin #addin nuget:?package=YoutubeExplode.Converter&version=6.2.10 // Install YoutubeExplode.Converter as a Cake Tool #tool nuget:?package=YoutubeExplode.Converter&version=6.2.10
YoutubeExplode.Converter
YoutubeExplode.Converter is an extension package for YoutubeExplode that provides the capability to download YouTube videos by muxing separate streams into a single file. This package relies on FFmpeg under the hood.
Install
- 📦 NuGet:
dotnet add package YoutubeExplode.Converter
Usage
YoutubeExplode.Converter exposes its functionality by enhancing YoutubeExplode's clients with additional extension methods. To use them, simply add the corresponding namespace and follow the examples below.
Warning: This package requires the FFmpeg executable to work, which can be downloaded here. Ensure that it's located in your application's probe directory or on the system's
PATH
, or provide a custom location directly using various overloads.
Downloading videos
You can download a video directly through one of the extension methods provided on VideoClient
.
For example, to download a video in the specified format using the highest quality streams, simply call DownloadAsync(...)
with the video ID and the destination path:
using YoutubeExplode;
using YoutubeExplode.Converter;
var youtube = new YoutubeClient();
var videoUrl = "https://youtube.com/watch?v=u_yIGGhubZs";
await youtube.Videos.DownloadAsync(videoUrl, "video.mp4");
Under the hood, this resolves the video's media streams, downloads the best candidates based on format, bitrate, framerate, and quality, and muxes them together into a single file.
Note: If the specified output format is a known audio-only container (e.g.
mp3
orogg
) then only the audio stream is downloaded.
Warning: Stream muxing is a resource-intensive process. You can improve the execution speed by making sure that both the input streams and the output file use the same format, which eliminates the need for transcoding. Currently, YouTube provides adaptive streams only in
mp4
andwebm
containers, with the highest quality video streams (e.g. 4K) only available inwebm
.
Customizing the conversion process
To configure various aspects of the conversion process, use the following overload of DownloadAsync(...)
:
using YoutubeExplode;
using YoutubeExplode.Converter;
var youtube = new YoutubeClient();
var videoUrl = "https://youtube.com/watch?v=u_yIGGhubZs";
await youtube.Videos.DownloadAsync(videoUrl, "video.mp4", o => o
.SetContainer("webm") // override format
.SetPreset(ConversionPreset.UltraFast) // change preset
.SetFFmpegPath("path/to/ffmpeg") // custom FFmpeg location
);
Manually selecting streams
If you need precise control over which streams are used for the muxing process, you can also provide them yourself instead of relying on the automatic resolution:
using YoutubeExplode;
using YoutubeExplode.Videos.Streams;
using YoutubeExplode.Converter;
var youtube = new YoutubeClient();
// Get stream manifest
var videoUrl = "https://youtube.com/watch?v=u_yIGGhubZs";
var streamManifest = await youtube.Videos.Streams.GetManifestAsync(videoUrl);
// Select streams (1080p60 / highest bitrate audio)
var audioStreamInfo = streamManifest.GetAudioStreams().GetWithHighestBitrate();
var videoStreamInfo = streamManifest.GetVideoStreams().First(s => s.VideoQuality.Label == "1080p60");
var streamInfos = new IStreamInfo[] { audioStreamInfo, videoStreamInfo };
// Download and process them into one file
await youtube.Videos.DownloadAsync(streamInfos, new ConversionRequestBuilder("video.mp4").Build());
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. 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. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 is compatible. 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. |
-
.NETCoreApp 3.1
- CliWrap (>= 3.6.0)
- YoutubeExplode (>= 6.2.10)
-
.NETFramework 4.6.1
- CliWrap (>= 3.6.0)
- YoutubeExplode (>= 6.2.10)
-
.NETStandard 2.0
- CliWrap (>= 3.6.0)
- YoutubeExplode (>= 6.2.10)
-
.NETStandard 2.1
- CliWrap (>= 3.6.0)
- YoutubeExplode (>= 6.2.10)
-
net5.0
- CliWrap (>= 3.6.0)
- YoutubeExplode (>= 6.2.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on YoutubeExplode.Converter:
Package | Downloads |
---|---|
MP3DL.lib
Package Description |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on YoutubeExplode.Converter:
Repository | Stars |
---|---|
Tyrrrz/YoutubeDownloader
Downloads videos and playlists from YouTube
|
|
crobibero/jellyfin-plugin-tmdb-trailers
|
Version | Downloads | Last updated |
---|---|---|
6.4.4 | 279 | 11/13/2024 |
6.4.3 | 2,358 | 10/3/2024 |
6.4.2 | 1,396 | 9/27/2024 |
6.4.1 | 820 | 9/18/2024 |
6.4.0 | 3,233 | 7/25/2024 |
6.3.16 | 4,616 | 5/21/2024 |
6.3.15 | 234 | 5/18/2024 |
6.3.14 | 1,567 | 4/27/2024 |
6.3.13 | 2,250 | 2/22/2024 |
6.3.12 | 3,823 | 1/18/2024 |
6.3.11 | 863 | 1/4/2024 |
6.3.10 | 640 | 12/27/2023 |
6.3.9 | 1,238 | 11/29/2023 |
6.3.8 | 928 | 11/23/2023 |
6.3.7 | 914 | 11/9/2023 |
6.3.6 | 1,152 | 10/17/2023 |
6.3.5 | 1,000 | 9/28/2023 |
6.3.4 | 1,308 | 9/6/2023 |
6.3.3 | 1,327 | 8/31/2023 |
6.3.2 | 1,019 | 8/18/2023 |
6.3.2-alpha1 | 599 | 7/30/2023 |
6.3.1 | 1,449 | 7/23/2023 |
6.3.0 | 681 | 7/20/2023 |
6.2.17 | 1,164 | 7/12/2023 |
6.2.16 | 1,224 | 6/28/2023 |
6.2.15 | 1,627 | 5/25/2023 |
6.2.14 | 1,982 | 5/2/2023 |
6.2.13 | 1,054 | 4/27/2023 |
6.2.12 | 1,769 | 3/31/2023 |
6.2.11 | 979 | 3/24/2023 |
6.2.10 | 816 | 3/17/2023 |
6.2.9 | 1,007 | 3/10/2023 |
6.2.8 | 5,304 | 3/1/2023 |
6.1.0 | 107,947 | 2/19/2022 |
6.0.8 | 13,622 | 2/10/2022 |
6.0.7 | 119,103 | 12/10/2021 |
6.0.6 | 4,650 | 12/9/2021 |
2.1.0 | 342,592 | 4/18/2021 |
2.0.2 | 2,559 | 12/26/2020 |
2.0.1 | 890 | 12/26/2020 |
2.0.0 | 2,641 | 10/14/2020 |
1.5.1 | 3,673 | 4/22/2020 |
1.5.0 | 1,243 | 4/13/2020 |
1.4.4 | 971 | 4/12/2020 |
1.4.3 | 3,948 | 7/27/2019 |
1.4.2 | 1,794 | 5/12/2019 |
1.4.1 | 1,698 | 3/3/2019 |
1.4.0 | 1,764 | 1/17/2019 |
1.3.0 | 1,194 | 1/16/2019 |
1.2.0 | 1,220 | 1/9/2019 |
1.1.0 | 1,153 | 1/8/2019 |
1.0.3 | 1,350 | 12/20/2018 |
1.0.2 | 1,217 | 12/17/2018 |
1.0.1 | 1,827 | 10/27/2018 |
1.0.0 | 1,278 | 10/27/2018 |