@Forgot Password Ok what you need to do is to download YoutubeExtractor from nuget.
I used following code in one of my projects to get youtube downloader working:
vb
Code:
Dim videoInfos As IEnumerable(Of VideoInfo) = DownloadUrlResolver.GetDownloadUrls("url of video")
Dim video As VideoInfo = videoInfos.Where(Function(info) info.CanExtractAudio).OrderByDescending(Function(info) info.AudioBitrate).First()
If video.RequiresDecryption Then
DownloadUrlResolver.DecryptDownloadUrl(video)
End If
Dim audioDownloader = New AudioDownloader(video, "1.mp3")
Try
audioDownloader.Execute()
Catch ex As Exception
MsgBox("Can't download this video, try other one", 0, "")
Return
End Try
nameofvideo = video.Title
converted to c#
Code:
IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls("url of video");
VideoInfo video = videoInfos.Where(info => info.CanExtractAudio).OrderByDescending(info => info.AudioBitrate).First();
if (video.RequiresDecryption) {
DownloadUrlResolver.DecryptDownloadUrl(video);
}
dynamic audioDownloader = new AudioDownloader(video, "1.mp3");
try {
audioDownloader.Execute();
} catch (Exception ex) {
Interaction.MsgBox("Can't download this video, try other one", 0, "");
return;
}
nameofvideo = video.Title;