Good morning
I'm trying to make an application with WindowsForm in C # to download YouTube audios . I use a Nuget package called YoutubeExtractor .
The code is as follows:
private bool DescargarAudio()
{
bool vf = false;
try
{
VideoInfo video = videoInfos.Where(info => info.CanExtractAudio).FirstOrDefault();//OrderByDescending(info => info.AudioBitrate)
if (video.RequiresDecryption)
{
DownloadUrlResolver.DecryptDownloadUrl(video);
}
var audioDownloader = new AudioDownloader(video, Application.StartupPath+video.Title + video.AudioExtension,320);
audioDownloader.Execute();
vf = true;
}
catch (Exception ex)
{
exception = ex.Message;
}
return vf;
}
The problem is that this line returns null :
VideoInfo video = videoInfos.Where(info => info.CanExtractAudio).FirstOrDefault();//OrderByDescending(info => info.AudioBitrate)
And I should return an item from the list. I tried several links and it always gives me the same. I do not know if it could be a problem with the dll or I'm doing something wrong.
Do you have a solution or is there some other package to do the same?
Greetings to all.
Happy Holidays.