spotDL / spotify-downloader

Download your Spotify playlists and songs along with album art and metadata (from YouTube if a match is found).
https://spotdl.readthedocs.io/en/latest/
MIT License
16.9k stars 1.55k forks source link

429/500/404 Errors and Rate Limiting Issues #2142

Open xnetcat opened 1 month ago

xnetcat commented 1 month ago

Hey everyone,

I've been seeing more 429/404/500 errors, and slow query processing lately. This is because of Spotify's rate limits on our shared project.

Quick Fix: Use Your Own Client ID and Secret

To avoid these issues, we recommend using your own client ID and secret from Spotify. Here’s how:

  1. Visit the Spotify Developer Dashboard: Go to Spotify Developer Dashboard.
  2. Log In: Sign in or create a Spotify account.
  3. Create a New App: Click "Create an App" and fill in the details. (Set APIs used to Web API and Redirect URIs to http://127.0.0.1:9900/ (or whatever you want to use))
  4. Get Your Credentials: Copy your client ID and secret.

Update Your Settings:

  1. Config File: Update your settings in the config file as described here.
  2. Command Line Options: Alternatively, use the following command line options:
    --client-id CLIENT_ID
    --client-secret CLIENT_SECRET

I’m working on a long-term fix to better manage our rate limits. Stay tuned for updates!

ForceConstant commented 1 month ago

I am confused, since I thought downloads are from youtube these days, what is the spotify key used for?

xnetcat commented 1 month ago

I am confused, since I thought downloads are from youtube these days, what is the spotify key used for?

Getting the metadata from Spotify. We can't do that without authorization.

flowerpoweruk commented 1 month ago

thank you @xnetcat this worked perfectly to resolve the issue.

unsync commented 1 month ago

i've been getting the same behaviour (sync hanging after DEBUG MainThread - Found 50 songs in 1 lists).

i'm rotating 3 different spotify apps, but still doesn't (always) helps.

any chance we could get some debug logs that could warn about the process being stuck and the reason ? (i guess if we don't get a console feedback after 30 minutes the issue is clear, but avoiding the infinite hanging would be nice)

square-nine commented 1 month ago

For anyone else having issues with the 429 Too Many Requests error: I just did this: https://github.com/spotDL/spotify-downloader/issues/2139#issuecomment-2241152315 And also what was recommended as the "quick fix" (first post in this issue)

And now, this works for small albums, but when I try on a larger playlist (like my 300+ liked songs) it returns the 429 error. No matter, for if that's the case, it's probably better to split your liked songs playlist into several smaller public playlists, to then download sequentially.

eltrueno commented 3 days ago

Fix doesn't work for me when searching for a song, only works if you enter album or song link. But still downloading very slowly compared to version 4.2.5

lancelotimb commented 2 days ago

FWIW, using the --user-auth option fixed the issue for me (specifying client id/secret did not work). You'd have to be logged in on your browser though.