-
-
Notifications
You must be signed in to change notification settings - Fork 466
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
Response status code does not indicate success: 429 (Too Many Requests) #292
Comments
How often are hitting that? |
sometime , i received,it seem issue from youtube limit rate, |
Hi There, I've managed to get a rough measurement on this issue as my discord bot get's flooded with 429s. I've estimated we can have 21 downloads within the space of about a few minutes before being blocked for a certain time period. I think it resets at a specific time. Not sure. After further experimenting, it may be possible to get away with maybe 1-2 download requests per minute. This is not confirmed as it's just a possible estimate. Only way we can test what the rate-limit is is to make a simple program that downloads a big playlist and adjust the rate-limit bit by bit until we get the sweet spot. Unless YT has rate-limits posted somewhere. |
Hi @ComputerMaster1st , |
Hi There, From what I've last heard, YT have changed stuff on their side to prevent anything & everything resembling a bot to download content from them. I know they've been fighting against bots for a long time, hence the whole signature nonsense. |
Could it optionally send the Google login cookie with each request? Then individuals shouldn't trigger the bot detection. |
@YoshiRulz you can do that now by injecting a custom |
@ComputerMaster1st honestly, the way they're fighting bots with signatures looks more like it's a software specification coming from the stakeholders that the developers don't care too much about. YouTube is much better at deterring bots by doing their random changes and not so much with signatures. |
hello I'm using, but can we overcome this problem with proxy server |
{"message":"Response status code does not indicate success: 429 (unknown).","data":{},"innerException":null,"stackTrace":" at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()\n at System.Net.Http.HttpClient.d__27.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at YoutubeExplode.YoutubeClient.d__35.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at YoutubeExplode.YoutubeClient.d__39.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at YoutubeExplode.YoutubeClient.d__43.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\n at |
I recommend adding backoff-and-retry via Polly or similar |
hello @Tyrrrz Can you teach us this method |
@Tyrrrz gives an error when many downloads are made |
Response status code does not indicate success: 429 (unknown). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.Http.HttpRequestException: Response status code does not indicate success: 429 (unknown). An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.[HttpRequestException: Response status code does not indicate success: 429 (unknown).] |
How many requests per minute are you making? |
Looks like an entire test run crashed due to this error |
Is anyone still getting 429? Looks like CI stopped getting them for a while. |
Looks like there's some discussion about this here: ytdl-org/youtube-dl#21729 |
I think ultimately the only solution here is to build a Polly policy to back off and retry on such failures. I can wrap this and similar exceptions in |
Decided to take a look at youtube-dl's issues board to see if they're dealing with something similar. Luckily, I can reproduce it pretty consistently on the CI runner but not locally. That said, I'm not sure if this can be "fixed". I've added tracing on every request/response to see what kind of information we can fish out. |
Hi There, Not sure if I should suggest this... Have you thought about fetching vids via YT Clones or do they end up going to the same endpoint aswell? (google in this case since vid urls point there) Just a suggestion. Not sure if you've already considered it. |
What are YT Clones? |
YouTube Clones. |
That didn't explain much |
YouTube Clones are as the name implies. They're basically copies of youtube and one of them did have their own download links. Can't remember which one it was. |
Hm, haven't used or seen any of them. |
I don't know if using proxy servers would help either. |
I'd say it should help but I'm wary to incorporate it in the library itself. You can use it on the consumer layer by supplying your own |
It is basically not possible to fix this issue with this Library.
How to prevent this issue:
|
I've read in some of the youtube-dl issues that the ban wears off after 12 hours or something like that, in which case Polly might not help, lol. Also, after adding diagnostics, I can see from the CI runs that the 429 errors are not accompanied by Retry-After headers or anything similar. It is quite annoying that it fails so often on CI though. This is currently my biggest issue with this whole thing. |
In my fork (different network stack) I've made a flag to toggle between real requests/responses and reading data from a file, then per-commit CI checks for regressions and I can manually check for YouTube changes (or set it up to run every month). Can you do something similar with |
I can, but there's not much benefit in running CI on cached data. I'm not really worried about regressions because there's almost no business logic, but I do need to be sure that the YouTube integration is working. Also, I think running it less often won't help because I was running it nightly before and it was still getting throttled once in a while. I'm guessing there are other projects that also send requests to YouTube from GitHub Actions and the external IP is shared between jobs. |
I recommend adding Polly into the app to handle the 429 and rate limiting. Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. https://github.com/App-vNext/Polly Read over the github page above. A short ready through the page should give you a fairly good idea of what it can do with failures, specific exceptions, retry delays and complete failure scenarios. The policies are quite well thought out imo. Best wishes |
Today I got the 429 error. Is there any update or discovery? |
Hi @zjjohncq, I think they're going to implement "Polly" into it. I'm not sure at this time. The best thing to do is to slow down how often you hit YouTube at this point. |
Is there specific how long we need to wait beween 2 requests: 1 min? 10 min or longer? |
No clue. Sorry. |
it seem issue from youtube limit rate, i have same issue
"message":"Response status code does not indicate success: 429 (unknown)."
although one request only
The text was updated successfully, but these errors were encountered: