4

I have a code to extract audio url using VideoLibrary. But Video.Uri throws an exception.

An invalid request URI was provided. The request URI must either be an absolute URI or BaseAddress must be set.

I can't understand why this happens. How can I solve this problem?

YouTube yt = YouTube.Default;
string link = "https://www.youtube.com/watch?v=QNJL6nfu__Q";
foreach (var item in yt.GetAllVideos(link))
{
   if (item.AdaptiveKind == AdaptiveKind.Audio)
      Console.WriteLine(item.Uri);
}
Ali Tor
  • 2,772
  • 2
  • 27
  • 58
  • Did you end up figuring out what was the issue? I'm having the exact problem, it was working for a while and now no matter what url I give it, it throws above error. – OverMars Mar 01 '18 at 03:23

1 Answers1

1

The VideoLibrary is outdated. Use the Nefarius-VideoLibrary instead

OverMars
  • 1,077
  • 3
  • 16
  • 33