Repository navigation
lyrics: give Genius its own, slower rate limit - #7232
Sabrina04072003 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7232 +/- ##
==========================================
+ Coverage 80.93% 80.95% +0.01%
==========================================
Files 150 150
Lines 21257 21258 +1
Branches 3246 3246
==========================================
+ Hits 17205 17209 +4
+ Misses 3244 3242 -2
+ Partials 808 807 -1
🚀 New features to boost your workflow:
|
|
Hi! I opened a PR with the first option (a separate, slower rate limit for Genius only): #7232 The value (1 request per second) is my estimate. If you prefer another change, please let me know and I will update it. Thank you! |
| self.mount("https://", adapter) | ||
| self.mount("http://", adapter) | ||
|
|
||
| # Genius answers "429 Too Many Requests" when queried too fast, so it |
There was a problem hiding this comment.
This is the wrong file for that logic. Genius rate limit should be defined the plugins code if possible. A bit of a strange coupling here.
Do we have any documentation for the rate limit? Is it really static? If it is not I would prefer an immediate retry and than an exponential backoff. We should have utils for this already too.
Related to #7226.
When many albums are imported, Genius can answer "too many 429 error responses".
All sites share one rate limit (0.25 s between requests). I think this is too fast for Genius.
This PR gives
api.genius.comits own, slower limit (1 request per second). Other sites and the Tidal plugin are not changed.The 1 second value is my estimate, and I could not test it against the real Genius API. I only checked by hand that api.genius.com gets a 1.0 s limit and other sites keep 0.25 s.
AI use: I used Claude to help me read the code and prepare this change.