libvideo (aka VideoLibrary) is a modern .NET library for downloading YouTube videos. It is portable to most platforms and is very lightweight.
You can grab a copy of the library on NuGet by running:
Install-Package VideoLibrary
Alternatively, you can try building the repo if you like your assemblies extra-fresh.
Here's a small sample to help you get familiar with libvideo:
using VideoLibrary;
void SaveVideoToDisk(string link)
{
var youTube = YouTube.Default; // starting point for YouTube actions
var video = youTube.GetVideo(link); // gets a Video object with info about the video
File.WriteAllBytes(@"C:\" + video.FullName, video.GetBytes());
}
Or, if you use Visual Basic:
Imports VideoLibrary
Sub SaveVideoToDisk(ByVal link As String)
Dim video = YouTube.Default.GetVideo(link)
File.WriteAllBytes("C:\" & video.FullName, video.GetBytes())
End Sub
If you'd like to check out some more of our features, take a look at our docs. You can also refer to our example application (named Valks, yes, I know, it's a silly name) if you're looking for a more comprehensive sample.
libvideo is licensed under the BSD 2-clause license.