omansak / libvideo

A lightweight .NET library to download YouTube videos.
BSD 2-Clause "Simplified" License
553 stars 163 forks source link

Error getting ANY videos or audios from YT #200

Closed wolfSYS closed 3 years ago

wolfSYS commented 3 years ago

I had to see that all of a sudden your library stopped working. It is not any longer possible to obtain any files from youtube.

yt-lib-not-any-files

Both GetAllVideosAsync() and GetVideoAsync() return NULL für every single YT ID.

RK4444 commented 3 years ago

Yeah, the same problem here

wolfSYS commented 3 years ago

We need the possibility to pass HttpClient to the YoutubeClient. In HttpClient we could set the CONSENT cookie for Youtube like this:

        Uri uri = new Uri("https://www.youtube.com");
        HttpClientHandler handler = new HttpClientHandler();
        handler.CookieContainer = new CookieContainer();
        handler.CookieContainer.Add(uri, new Cookie("CONSENT", "YES+cb", "/", "youtube.com"));
        HttpClient hc = new HttpClient(handler);

        // that would be needed:
        YoutubeClient youtube = new YoutubeClient(hc);_
omansak commented 3 years ago

please test #201

omansak commented 3 years ago

please test 3.1.1 on github and nuget

wolfSYS commented 3 years ago

solved with ver 3.1.1 thx a lot!