"Sign in to confirm you’re not a bot." error with YouTube videos
Bug Description
Playing YouTube videos may fail with the error "Sign in to confirm you’re not a bot."
YouTube seems to have recently rolled out this measure. It's affecting not only third party players/clients, but also YouTube's official website & apps when logged out. Several communities have come across a few discoveries. Here's a summary of what I've seen:
- This is an IP block.
- Instead of just banning one IP, it looks YouTube is blocking whole ASNs/IP ranges. If you encounter this issue, it's likely a "neighboring" IP address was bombarding YouTube, causing them to block the ASN/IP range you're in.
- The cobalt.tools developers seem to have found a workaround using OAuth2. This currently has a PR in the lavaplayer youtube source manager, however it seems a bit risky.
We are in the process of implementing OAuth2 login for JMusicBot in #1670. Use this with an alternative/burner!!! Google account to play tracks again on blocked IPs.
Checklist
- [X] I have looked for information about this within the documentation
- [X] I have searched for similar issues on the issues page
- [X] I am running the latest version of the bot:
Also having this issue, if anyone has a solution or a quick and dirty workaround, I'd be down
downloading youtube videos through tor might be a workaround for this problem. just tested this, it works
$ torsocks yt-dlp https://youtu.be/AL5vANu2gok
[youtube] Extracting URL: https://youtu.be/AL5vANu2gok
[youtube] AL5vANu2gok: Downloading webpage
[youtube] AL5vANu2gok: Downloading ios player API JSON
[youtube] AL5vANu2gok: Downloading player 4fc7f9fa
[youtube] AL5vANu2gok: Downloading m3u8 information
[info] AL5vANu2gok: Downloading 1 format(s): 302+251
[download] Destination: Black Holes Explained For Gen-Z [AL5vANu2gok].f302.webm
[download] 100% of 48.22MiB in 00:03:40 at 223.78KiB/s
[download] Destination: Black Holes Explained For Gen-Z [AL5vANu2gok].f251.webm
[download] 100% of 10.01MiB in 00:00:49 at 207.41KiB/s
[Merger] Merging formats into "Black Holes Explained For Gen-Z [AL5vANu2gok].webm"
Deleting original file Black Holes Explained For Gen-Z [AL5vANu2gok].f302.webm (pass -k to keep)
Deleting original file Black Holes Explained For Gen-Z [AL5vANu2gok].f251.webm (pass -k to keep)
This other repo fixed the issue by adding support for Oauth2, essentially allowing people to create dummy accounts for the bots to log in with: https://github.com/imputnet/cobalt/issues/551
Is this something we'd have to request support for in lavaplayer? Or is MusicBot responsible for querying the youtube API?
I'm facing the same issue:
Jun 17 23:49:14 env[441177]: [23:49:14] [ERROR] [AudioHandler]: Track BJhF0L7pfo8 has failed to play Jun 17 23:49:14 env[441177]: com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Sign in to confirm you’re not a bot Jun 17 23:49:14 env[441177]: at dev.lavalink.youtube.clients.skeleton.Client.getPlayabilityStatus(Client.java:72) Jun 17 23:49:14 env[441177]: at dev.lavalink.youtube.clients.skeleton.NonMusicClient.loadTrackInfoFromInnertube(NonMusicClient.java:98) Jun 17 23:49:14 env[441177]: at dev.lavalink.youtube.clients.skeleton.StreamingNonMusicClient.loadFormats(StreamingNonMusicClient.java:35) Jun 17 23:49:14 env[441177]: at dev.lavalink.youtube.track.YoutubeAudioTrack.loadBestFormatWithUrl(YoutubeAudioTrack.java:175)
I can confirm that with my VPS Server, it logs a "Sign in to confirm you’re not a bot." error everytime I want to play a youtube video on my server.
HOWEVER, just recently I found out my old instance of my bot in my local machine work perfectly with youtube. Perhaps it's something to do with how the I.P of my local machine is tied to my youtube account perhaps? maybe youtube blocked requests from my server because of that.
a bot called "Nero Bot" manages to still play YT videos- would be worth looking into how they manage past the whole thing with their "nodes".
a bot called "Nero Bot" manages to still play YT videos- would be worth looking into how they manage past the whole thing with their "nodes".
- Nero Bot is not open source
- Minerea is also able to play YT. Not open source
- Chances are they are paying for a YT API or idk
Some people over lavaplayer suggests to use lavaplayer-fork to solve youtube issues
Some people over lavaplayer suggests to use lavaplayer-fork to solve youtube issues
We're already using lavalink's lavaplayer fork, which is still receiving maintenance. For this issue specifically, a simple update is very unlikely to fix anything, because this block also affects all of YouTube's own apps/clients.
So I guess this is a problem to any bot playing from YouTube as a source, right?
See the various other issues on the internet on this topic for a rough history of this. The cobalt.tools developers seem to have found a workaround related to OAuth2, however this has not been implemented in any lavaplayer fork yet, and also seems a bit risky.
The issue is fixed for me on version 0.4.2 🎉
As this is an issue that affects every project using YouTube, several communities have come across a few discoveries. Here's a summary of what I've seen:
- This is an IP block.
- Instead of just banning one IP, it looks YouTube is blocking whole ASNs/IP ranges. If you encounter this issue, it's likely a "neighboring" IP address was bombarding YouTube, causing them to block the ASN/IP range you're in.
- The cobalt.tools developers seem to have found a workaround using OAuth2. This currently ~~is not implemented in lavaplayer~~ has a PR in the lavaplayer youtube source manager, however it seems a bit risky.
- IPv6 rotation might also work, which lavaplayer supports & encourages using. We haven't put much thought about supporting IPv6 rotation on JMusicBot yet though.
In my opinion, I see three main ways JMusicBot could move forward:
- Wait for OAuth2 support to be arrive in the lavaplayer youtube source manager & make use of that
- Allow configuring IPv6 rotation for users on VPS' as they are most commonly affected by these blocks.
- Implement support for an external tool (cobalt.tools) as a source, which have circumvented this block. I'm not sure if they would appreciate the additional traffic from JMusicBot users though.
Only my two cents though, no discussion around this has happened yet.
This same issue has started occurring for me, has an easy solution been found yet? (one that a novice like me could implement)
There is no solution at the moment.
This started affecting me on a Hetzner IP range yesterday. Not a solution per se, but managed to temporarily workaround it by routing my jmusicbot Docker container through my WireGuard Docker container running a config from a paid VPN service.
This started affecting me on a Hetzner IP range yesterday
I'm also using Hetzner. Not sure if that's a coincidence or not.
I'm also using Hetzner. Not sure if that's a coincidence or not.
This is expected. As I mentioned earlier, it seems like YouTube is banning entire ASNs/IP ranges, rather than just individual IP addresses. Chances are pretty high that all of Hetzner’s ASNs/IPs have been banned.
As a test, on my server computer i created a new google account (so it appears that the registration is occurring from the banned ip) and logged in. I was able to play youtube video's in the browser! But when i log out in browser, once again im presented with the error. So if the bot can log into youtube, that should solve the problem for everyone.
So if the bot can log into youtube, that should solve the problem for everyone.
No, apparently this block affects both with or without an account, on the same IP. See: https://github.com/lighttube-org/LightTube/issues/154 https://github.com/yt-dlp/yt-dlp/issues/10085
Edit: Oops, I mentioned another problem without even paying much attention. Yes, you can "fix" it by connecting with an account (https://github.com/yt-dlp/yt-dlp/issues/10128#issuecomment-2185261677), but I don't think it would be very ideal for a project like this (Not to mention that Google can easily end up discovering this repository and try to destroy it, I think). The only four solutions I've seen for now are:
- Add full support for IPv6 rotation, as stated earlier in this Issue.
- Set PO_token e visitordata ID (https://github.com/iv-org/invidious/pull/4789; and it's still in WIP, and I don't know if their correction can be valid here or in lavaplayer)
- Wait for lavaplayer support to add OAuth2 (And yes, it is still risky and is a temporary solution)
- Change the default client player to
web_creator, since it was one that was not affected by the new change. (https://github.com/yt-dlp/yt-dlp/pull/10457; the only problem is that there will be audio loss, and it's also a fairly temporary solution, since YouTube can change this client as well)
While there is no 100% working solution, the only way to continue using the bot is to go to IPs, servers and/or VPNs that YouTube has not (yet) blocked.
this also affects me i used netrc file and add the credentials of youtube but still get the same error
YT seems to want to shoot a bullet in his own foot.... I have the same issue from 4 servers in 4 different DC. well done YT, soon you are going to ban yourself as some of your servers are hosted in the same DC of ours!
can confirm it's happening for me on hetzner also
not using musicbot though
It’s also happening to me on Aruba (Italian hosting provider)
Same. Not working for me either. Using a Hetzner Dedicated Server with Windows Server 2022 // Docker Desktop.
i am just popping in to say that after a bunch of tinkering with my OVHcloud server yesterday i only found out that if you run jmusicbot and then a VPN (OpenVPN + Windscribe is what ive used) on top of it then will the bot finally be able to play youtube links without any issues, granted this is still a workaround and you may have to restart your vpn again each time if youtube happens to ban the one the vpn is running on but so far ive had 0 issues since ive went and used this solution. just thought id let everyone know about this since ive seen a bunch of people still trying to figure out how to get their bot to play yt links so yeah i hope this helps
same on OVH server.. any resolution is planned?
same on OVH server.. any resolution is planned?
Using cloudflare warp on my racknerd vps fixed the issue BUT i lost accès to ssh and now use vnc because I didn't set up cloudflare warp correctly and I'm too lazy to reinstall it, I reccomend you to search on google stuff like "can't accès ssh after installing cloudflare warp" and you will probably find something to not have the same issue as me
Sorry if my English is bad
Hello! I also encountered the same problem. Has anyone found a solution to this problem? My server is from Hentzer. Located in Finland!
Of course I have a nextcloud cloud. But maybe someone already knows the solution to this problem?
But maybe someone already knows the solution to this problem?
No, it doesn't have a 100% effective solution so far. There are repositories with the same problem, and others have some pulls that can fix the problem, but many will fix it temporarily.
The best thing to do is to wait.