-
-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New anti-bot blocker on Youtube prevents to get video manifests #794
Comments
I don't think there's much that you can do if that's the case. Would have to sign in. |
This was kind of random before... it's extremely repeatable now. |
I am also getting "Video 'AfWnMPDM0G4' is not available." from our Azure servers, noit getting it locally. Is it possible to use proxies with Explode? |
There is a YoutubeClient constructor overload taking a HttpClient as argument, which can be configured to use a proxy. |
Thank you, should have seen that. Using proxies have solved the issue for me. |
Maybe you could try bringing your authentication cookies or anti-bot cookies |
According to youtube-dl, cookies probably won't work for long if they even work at all. ytdl-org/youtube-dl#32905 (comment) |
Is there any way to make an authenticated request to satisfy anti-bot protection? |
Somewhat useful observations:
|
99% answers can usually be found in the readme: https://github.com/Tyrrrz/YoutubeExplode#authentication |
When testing locally, it seems that instrumenting a short delay with no parallelism helped avoid the bot flagging mechanism (see #813). Also, when the client does get flagged, the issue automatically goes away after some time (not sure on the exact duration, but definitely less than an hour). On CI, however, this did not yield any useful results. It seems that the public GitHub Actions runners are pre-identified as suspicious by YouTube and the corresponding requests are pre-emptively banned. I imagine the same would apply to apps running on other public infrastructure as well. |
Thank you very much, I am using an application that calls YoutubeExplode, I'll report your answer there. |
I've switched for a personal project to YoutubeDLSharp with yt-dlp and a youtube oauth login plugin Hadn't had any issues with it yet |
original post is vague as hell, to the point of being not actionable - can someone please describe an actual test case? I might have a fix but its impossible to say give the current (lack of) information |
@3052 personally, I have a jellyfin plugin using this library. This unit tests is failing because of YouTube's anti bot measures. My guess is YouTube is blocking the IPs of GitHub runners. Edit: Same issue with yt-dlp (saw your comment there) and youtube-dl with other repos. |
I was able to reproduce the issue by running YoutubeExplode's test suite 2-3 times. It's also consistently reproducible on CI because the agent's IP/range is presumably banned: https://github.com/Tyrrrz/YoutubeExplode/actions/runs/11024028945 |
OK I will continue my work in private then, good luck |
@Tyrrrz you can consistently reproduce at home/office if you connect to almost any VPN. |
I tried |
For me, the result is the same (everything still blocked in CI) LizardByte/Themerr-jellyfin#546 |
6.4.2 didn't do anything about this particular issue, it solved other class of 403 errors |
I don't know if I should create a new issue, but GetMuxedStreams is not working. and after so many attempts it asks me to log in. GetAudioOnlyStreams works correctly. |
That's documented in the release notes: https://github.com/Tyrrrz/YoutubeExplode/releases/tag/6.4.2 |
Oh, you're right, I overlooked that. Thanks for replying. |
@Tyrrrz is there a way to disable parallelism when making httpRequests? For my app it is more important to be reliable in downloading than performant. Please let me know if I can contribute in any way to avoid youtube flagging a client as a bot. |
There is no parallelism in HTTP requests unless you explicitly instrument it |
If my app is a website (in-browser), I can't copy cross-site cookies like you would do with a webview in WPF app.
Is there any way to use this token with YouTubeExplode client to access user's videos (for download purposes ofcourse)? |
To my knowledge, you can't use that access token. Do note that downloading videos isn't something YouTube wants to support, so whichever way you find to make it possible, it's probably not going to be an official way (which OAuth is). |
Any idea how to fix this issue ("Please sign in") or do I need to use another library? |
FWIW: Open source https://freetubeapp.io/ plays and downloads videos without any login on the same blacklisted IP where Firefox and other download tools are required to login in order to view. |
Version
6.3.16
Platform
.NET 8 / Debian
Steps to reproduce
Query and download many videos for a longer time on the same system with static IP address.
Details
I am executing YoutubeExplode on a Debian server with static IP address.
Since a few days I am encountering the following exception on the GetManifestAsync method:
Seems like Youtube added a new mechanism to stop multiple videos to be queried/downloaded from the same machine/IP without logging in.
Checklist
The text was updated successfully, but these errors were encountered: