-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Youtube Issue] Error when loading from YouTube (429/captcha form) #305
Comments
Add the option for a local persistant music cache so music from youtube has to only be streamed (and saved) once. |
A cache of songs is something I've thought about before (and will continue to think about), but there are several issues. Lavaplayer (the internal library used for loading youtube and other sources) is strictly a streaming tool, and thus the songs that are streamed never have associated files. To cache music, all of the streamed packets would need to be collected, encoded, and saved to a valid format. This would technically be possible, but would break down when streaming live sources or when seeking within tracks. Therefore, the songs would need to be downloaded separate from the stream, which would mean potentially worsening the ratelimit issue (depending on when things were downloaded). This would additionally require a lot of work to write such a downloading & encoding system, or adding new dependencies like python & youtube-dl to handle the downloading. This would also require a new searching mechanism to handle caching the results of searches (as even searching - not even playing - can affect ratelimiting). Other minor issues include disk space and search results changing over time, both of which could potentially be solved by having a time- or disk-size-based expiry system for the cache. Licenses and copyrighted content would be another issue. Overall, I think the easiest solution for the majority of people would be to just play more local files; use local files or mp3 urls in playlists, and keep other local files under simple and easy-to-access filenames. Adding play shortcuts (key-value pairs of keyword to song uri) might be a feature to assist with this as well. |
This is true, I have been hit with a rate limit but my friend that works for google’s YouTube department said that if you fake a browser agent it will make it look like a normal person. This will not initiate a rate limit as soon or at all in some cases. Maybe something we should look into. I have connected my system to a squid proxy that fakes the browser agent and have not been hit since. The bot has been running on YouTube every day since May. |
This is also promising |
I believe lavaplayer already does this, but this is definitely not the only factor. Google has different limits for different IP ranges as well. For example, running the bot on a home network (consumer IP block) will be far less-likely to get locked out than running it from a known cloud network.
That doesn't look promising for small, self-hosted bots. It seems more aimed towards larger bots that likely have a lot of IP addresses at their disposal (or can afford to purchase blocks of IPs) that can be cycled through. I don't IP cycling will be useful for the average JMusicBot user, who likely hosts on their home network or a VPS with only one IP (or even a shared IP). Also, it seems that another new issue is popping up: sedmelluq/lavaplayer#248 Overall, it seems like Google is very intent on stopping music bots & other similar applications, so my instinct would be to move away from using YouTube as the primary source for songs instead of constantly jumping through ever-changing hoops. |
https://hastebin.com/oguyocumet.xml As requested console ouput of the error |
I've copied the complete folder and ran it on another pc and it worked like a charm, I am gonna look into it if I can find the issue that causes this. I will do a system restore to 11 days ago when it was working good, the programs that were updated are these (top list is currently installed bottom how it was 11 days ago): |
Based on the console output, this looks like that is a similar issue; same cause (a lot of traffic) but instead of a 429, YouTube is requesting you complete a captcha. You might be able to complete that in your browser, but I don't think there is any solid/long-term solution other than just keeping the bot offline for a while, and making sure that you're not opening too many streams at once.
|
Yeah the captcha would only complete for one request to go through not anymore so even if he completed it it would not help |
What if we were willing to pay a captcha solving service? Any possibility of that? |
I think that's a bit out of the scope of a personal music bot. If anything, I think the solution to captchas would be to somehow forward them to the bot owner or the person trying to play the song, but even that could be difficult. Also, that would only solve a subset of the issues that people are facing with YouTube (it wouldn't solve ratelimits or other video blockages). |
Just download your favorite songs off YouTube and play them using Music-bot from a wav file. |
This comment has been minimized.
This comment has been minimized.
I use windows 10 64 bit and i run it on my normal computer |
That is not related to this issue, that just means you aren't using 64-bit java |
I think this ties into it also: ^ Fixed with dependencies update of the latest release |
I downloaded my whole default playlist using YouTube-dl, working great. Super easy to do with https://github.com/MrS0m30n3/youtube-dl-gui because I'm not too experienced with terminal programs. |
I just installed the bot and got rate-limited when loading a playlist :s |
I run the bot but sometimes it works and some do not , and I noticed something when searching for something in the English, Arabic language that does not work and there’s a mistake occurs, I do not think that the connection ban because I tried it on my device and private servers , and the same problem I was trying all versions of the bot so I had no problems except After the new updates |
Mr.jagrosh You can make sure at first it will start, then wait for a few mistakes, but you must leave the bot in the room |
I contact with new ip , but i has the same problem and idk the reason . I’m sure there’s something must be fixed in bot . Also i chatted my friends and there have the problem too . Should I open New issue ? [17:15:17] [INFO] [Startup]: Loaded config from C:\Users\Administrator\Desktop\Bot\config.txt |
If you get a 429 (as per your logs), it is this issue, there's no need to open a duplicate |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
So, I've ran into this issue as well as of late. I've found that the auto playlist command tends to aggravate YouTube into striking the bot down. Currently, my personal work around for this was to fork this project and create a branch of my fork which has the command disabled (it's a pretty janky system on my end, and I haven't tested it yet.) I made it such that the event sends an error message instead and explains that I've disabled the feature. Going to test tomorrow to make sure I didn't break anything. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Just got this error after like 1-2 years of using the bot. Curious if there's a work around? Seems to have happened to me once i added 200 YT Videos to the playlist was at 130 before. If not I was wondering if there is some way we could link this through a VPN in like an advanced setting. (Ideally a config option to use 'default ip' or 'custom ip=XXX.XXX.XXX.XXX') to redirect the bot through a VPN would be ideal). If not i can probably setup a VMBox and try and redirect the traffic through the vpn that way, but that maybe more complex & im not sure how that would affect the bot. |
Is there a reason the bot can't cache http requests? I set this up in python the other day and it was extremely easy. Java solution (I haven't looked into it extensively) Obviously this would get pretty big, so you can make it optional, set a size limit, and allow configuring expiration periods, but it would help heavy bot users at least. |
What is the current progress on this? I'm getting some warning messages, but the bot generally functions fine.
|
@adamhradil those logs are not related to this issue; those logs are the result of the bot attempting to put the "now playing" info in a channel topic (which itself is the result of the bot having the Manage Channels permission in the channel in which you've used settc). |
Describe the bug
YouTube has recently starting enforcing ratelimits. This is likely because streaming the data directly harms their service (as they receive no ad revenue when videos are streamed in this way). When your IP is ratelimited, no data from YouTube can be loaded, and attempting to load anything from YouTube will result in an error.
Does this affect you?
Invalid status code for video page response: 429
in error messages, it means that your IP has been ratelimited.Sorry for the interruption. We have been receiving a large volume of requests from your network.
in error messages, it means that YouTube is is requesting a captcha for your requests.Solution
There is no solid solution to this at the moment. Your best options are:
Version Info
This affects all connections to YouTube, regardless of which version of JMusicBot is used.
Additional Info
Here's the information that YouTube/Google provides when a music bot (or any service really) gets ratelimited:
The text was updated successfully, but these errors were encountered: