YouTubeApiSharp
v.0.0.5

.NET(C#,VB.NET)的完整私有YouTube API。
Nuget的YouTubeaPisharp
Install-Package YouTubeApiSharp
YouTubeApisharp代码已根据MIT许可证获得许可。
获取下载URL
// Our test youtube link
string link = "insert youtube link" ;
/*
* Get the available video formats.
* We'll work with them in the video and audio download examples.
*/
IEnumerable < VideoInfo > videoInfos = DownloadUrlResolver . GetDownloadUrls ( link ) ;下载视频
// Select the first .mp4 video with 360p resolution
VideoInfo video = videoInfos
. First ( info => info . VideoType == VideoType . Mp4 && info . Resolution == 360 ) ;
// Decrypt only if needed
if ( video . RequiresDecryption )
{
DownloadUrlResolver . DecryptDownloadUrl ( video ) ;
}
// Create the video downloader.
VideoDownloader dl = new VideoDownloader ( ) ;
dl . DownloadFile ( video . DownloadUrl , video . Title , true , Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) , video . VideoExtension ) ;