Tyrrrz / YoutubeExplode

Abstraction layer over YouTube's internal API
MIT License
2.97k stars 497 forks source link

Age-restricted content cannot be parsed, 403 is returned #806

Closed Aimeast closed 2 months ago

Aimeast commented 3 months ago

Version

6.4.0.0

Platform

.NET8 / Windows 10 & Ubuntu 24

Steps to reproduce

var httpClient = CreateHttpClient(); // All browser cookies have been loaded
var youtube = new YoutubeClient(httpClient);
var video = await youtube.Videos.GetAsync("https://www.youtube.com/watch?v=rXMX4YJ7Lks"); // This Id was mentioned in #606

Exception: HttpRequestException: Response status code does not indicate success: 403 (Forbidden).

Details

I noticed that #606 solved the access to age-restricted content, but now it seems that age-restricted content cannot be parsed successfully, even with all cookies attached. I used the videoId="rXMX4YJ7Lks" modified by #606 for testing. I don't know where I used it wrong, or if parsing age-restricted content is not supported now.

Checklist

Tyrrrz commented 3 months ago

Yeah, it routinely gets broken by YouTube. Although it's weird that it doesn't work with cookies.

Tyrrrz commented 2 months ago

Duplicate of #795