YoutubeExplode alternatives and similar packages
Based on the "Misc" category.
Alternatively, view YoutubeExplode alternatives based on common mentions on social networks and blogs.
-
Polly
Express transient exception handling policies such as Retry, Retry Forever, Wait andRetry or Circuit Breaker in a fluent manner. (.NET 3.5 / 4.0 / 4.5 / PCL / Xamarin) -
FluentValidation
A small validation library for .NET that uses a fluent interface and lambda expressions for building validation rules. -
Humanizer
Humanizer meets all your .NET needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities -
ReactJS.NET
ReactJS.NET is a library that makes it easier to use Babel along with Facebook's React and JSX from C#. -
Jint
Javascript interpreter for .NET which provides full ECMA 5.1 compliance and can run on any .NET plaftform. -
Coravel
Near-zero config .NET Core library that makes Task Scheduling, Caching, Queuing, Mailing, Event Broadcasting (and more) a breeze! -
Jurassic
A implementation of the ECMAScript language and runtime. It aims to provide the best performing and most standards-compliant implementation of JavaScript for .NET. -
HidLibrary
This library enables you to enumerate and communicate with Hid compatible USB devices in .NET. -
Warden
Define "health checks" for your applications, resources and infrastructure. Keep your Warden on the watch -
Jot
a library for persisting and restoring application state (a better alternative to .settings files). -
ByteSize
ByteSize is a utility class that makes byte size representation in code easier by removing ambiguity of the value being represented. ByteSize is to bytes what System.TimeSpan is to time. -
Mediator.Net
A simple mediator for .Net for sending command, publishing event and request response with pipelines supported -
SolidSoils4Arduino
C# .NET - Arduino library supporting simultaneous serial ASCII, Firmata and I2C communication -
FormHelper
Form & Validation Helper for ASP.NET Core. Form Helper helps you to create ajax forms and validations without writing any javascript code. (Compatible with Fluent Validation) -
DeviceDetector.NET
The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model. -
Jering.Javascript.NodeJS
Invoke Javascript in NodeJS, from C# -
https://github.com/minhhungit/ConsoleTableExt
Fluent library to create table for .Net console application. -
Outcome.NET
Never write a result wrapper again! Outcome.NET is a simple, powerful helper for methods that return a value, but sometimes also need to return validation messages, warnings, or a success bit. -
FlatMapper
A library to import and export data from and to plain text files in a Linq compatible way. -
NaturalSort.Extension
Extension method for StringComparer that adds support for natural sorting (e.g. "abc1", "abc2", "abc10" instead of "abc1", "abc10", "abc2"). -
trybot
A transient fault handling framework including such resiliency solutions as Retry, Timeout, Fallback, Rate Limit and Circuit Breaker. -
AdaskoTheBeAsT.FluentValidation.MediatR
FluentValidation behavior for MediatR -
Validot
Validot is a performance-first, compact library for advanced model validation. Using a simple declarative fluent interface, it efficiently handles classes, structs, nested members, collections, nullables, plus any relation or combination of them. It also supports translations, custom logic extensions with tests, and DI containers. -
.NET Fiddle
Write, compile and run C# code in the browser. The C# equivalent of JSFiddle. -
MSBuild ILMerge task
MSBuild ILMerge task is a NuGet package allows you to use the famous ILMerge utility in automated builds and/or Visual Studio projects.
Get performance insights in less than 4 minutes
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of YoutubeExplode or a related project?
README
YoutubeExplode
Project status: maintenance mode (bug fixes only).
YoutubeExplode is a library that provides an interface to query metadata of YouTube videos, playlists and channels, as well as to resolve and download video streams and closed caption tracks. Behind a layer of abstraction, the library parses raw page content and uses reverse-engineered AJAX requests to retrieve information. As it doesn't use the official API, there's also no need for an API key and there are no usage quotas.
This library is used in YoutubeDownloader, a desktop application for downloading and converting YouTube videos.
Download
- NuGet:
dotnet add package YoutubeExplode
Features
- Retrieve metadata on videos, playlists, channels, streams, and closed captions
- Execute search queries and get resulting videos
- Get or download video streams, with support for seeking
- Get closed captions or download them as SRT files
- Works with .NET Standard 2.0+, .NET Core 2.0+, .NET Framework 4.6.1+
Screenshots
[demo](.screenshots/demo.png)
Usage
- Getting metadata of a video
- Downloading a video stream
- Working with playlists
- Extracting closed captions
Getting metadata of a video
The following example shows how you can extract various metadata from a YouTube video:
var youtube = new YoutubeClient();
// You can specify video ID or URL
var video = await youtube.Videos.GetAsync("https://youtube.com/watch?v=u_yIGGhubZs");
var title = video.Title; // "Collections - Blender 2.80 Fundamentals"
var author = video.Author; // "Blender"
var duration = video.Duration; // 00:07:20
Downloading a video stream
Every YouTube video has a number of streams available. These streams may have different containers, video quality, bitrate, etc.
On top of that, depending on the content of the stream, the streams are further divided into 3 categories:
- Muxed streams -- contain both video and audio
- Audio-only streams -- contain only audio
- Video-only streams -- contain only video
You can request the stream manifest to get available streams for a particular video:
var youtube = new YoutubeClient();
var streamManifest = await youtube.Videos.Streams.GetManifestAsync("u_yIGGhubZs");
Once you get the manifest, you can filter through the streams and choose the one you're interested in downloading:
// Get highest quality muxed stream
var streamInfo = streamManifest.GetMuxed().WithHighestVideoQuality();
// ...or highest bitrate audio-only stream
var streamInfo = streamManifest.GetAudioOnly().WithHighestBitrate();
// ...or highest quality MP4 video-only stream
var streamInfo = streamManifest
.GetVideoOnly()
.Where(s => s.Container == Container.Mp4)
.WithHighestVideoQuality()
Finally, you can get the actual Stream
object represented by the metadata:
if (streamInfo != null)
{
// Get the actual stream
var stream = await youtube.Videos.Streams.GetAsync(streamInfo);
// Download the stream to file
await youtube.Videos.Streams.DownloadAsync(streamInfo, $"video.{streamInfo.Container}");
}
While it may be tempting to just always use muxed streams, it's important to note that they are limited in quality. Muxed streams don't go beyond 720p30.
If you want to download the video in maximum quality, you need to download the audio-only and video-only streams separately and then mux them together on your own. There are tools like FFmpeg that let you do that. You can also use YoutubeExplode.Converter which wraps FFmpeg and provides an extension point for YoutubeExplode to download videos directly.
Working with playlists
Among other things, YoutubeExplode also supports playlists:
var youtube = new YoutubeClient();
// Get playlist metadata
var playlist = await youtube.Playlists.GetAsync("PLa1F2ddGya_-UvuAqHAksYnB0qL9yWDO6");
var title = playlist.Title; // "First Steps - Blender 2.80 Fundamentals"
var author = playlist.Author; // "Blender"
// Enumerate through playlist videos
await foreach (var video in youtube.Playlists.GetVideosAsync(playlist.Id))
{
var videoTitle = video.Title;
var videoAuthor = video.Author;
}
// Get all playlist videos
var playlistVideos = await youtube.Playlists.GetVideosAsync(playlist.Id);
// Get first 20 playlist videos
var somePlaylistVideos = await youtube.Playlists
.GetVideosAsync(playlist.Id)
.BufferAsync(20);
Extracting closed captions
Similarly to streams, you can extract closed captions by getting the manifest and choosing the track you're interested in:
var youtube = new YoutubeClient();
var trackManifest = await youtube.Videos.ClosedCaptions.GetManifestAsync("u_yIGGhubZs");
// Select a closed caption track in English
var trackInfo = trackManifest.TryGetByLanguage("en");
if (trackInfo != null)
{
// Get the actual closed caption track
var track = await youtube.Videos.ClosedCaptions.GetAsync(trackInfo);
// Get the caption displayed at 0:35
var caption = track.TryGetByTime(TimeSpan.FromSeconds(35));
var text = caption?.Text;
}
You can also download closed caption tracks as SRT files:
var trackInfo = trackManifest.TryGetByLanguage("en");
if (trackInfo != null)
{
await youtube.Videos.ClosedCaptions.DownloadAsync(trackInfo, "cc_track.srt");
}
Etymology
The "Explode" in YoutubeExplode comes from the name of a PHP function that splits up strings, explode()
. When I was just starting development on this library, most of the reference source code I read was written in PHP, hence the inspiration for the name.