I wish to download a video from YouTube and then extract its audio.
Can anyone point me to some C# code to download a video?
For clarification purposes, I already know how to extract audio from a .FLV file like these.
I wish to download a video from YouTube and then extract its audio.
Can anyone point me to some C# code to download a video?
For clarification purposes, I already know how to extract audio from a .FLV file like these.
I suggest you to take a look into SharpGrabber - a .NET Standard library I've written just for this purpose. It is newer than YouTubeExtractor and libvideo.
It supports YouTube and Vimeo at the time of this answer. This project also offers high-quality video and audio muxing and a cross-platform desktop application.
libvideo https://github.com/omansak/libvideo (aka VideoLibrary) is a modern .NET library for downloading YouTube videos. It is portable to most platforms and is very lightweight.
This is recommended for more downloads and more popularity.
Use it for just few simple codes:
using VideoLibrary;
void SaveVideoToDisk(string link)
{
var youTube = YouTube.Default;
var video = youTube.GetVideo(link);
File.WriteAllBytes(@"C:\" + video.FullName, video.GetBytes());
}