Skip to content
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

404 error when getting track/album/playlist/artist data #795

Open
xnetcat opened this issue Apr 7, 2022 · 2 comments
Open

404 error when getting track/album/playlist/artist data #795

xnetcat opened this issue Apr 7, 2022 · 2 comments
Labels

Comments

@xnetcat
Copy link

xnetcat commented Apr 7, 2022

Describe the bug
Hi, a lot of users started reporting to me that they are getting 404 errors.
The url to the song is valid, We've tried clearing the cache but it didn't help.
Sometimes it works sometimes it doesn't seems pretty random.
This started happening few days ago.

Your code
SpotifyClient from here: https://github.com/spotDL/spotify-downloader/blob/master/spotdl/search/spotify_client.py
and then

# Initialize spotify client
SpotifyClient.init(
	client_id="working_id",
    client_secret="working_secret",
    user_auth=False,
)

spotify_client = SpotifyClient()

data = spotify_client.track(spotify_url)

Expected behavior
We always get the data.

Output

HTTP Error for GET to https://api.spotify.com/v1/tracks/5aeMTTkvye4ERaMni9k399 with Params: {'market': None} returned 404 due to None
http status: 404, code:-1 - https://api.spotify.com/v1/tracks/5aeMTTkvye4ERaMni9k399:
 None, reason: None

Environment:

  • OS: Windows, Linux
  • Python version: from 3.7 to 3.10
  • spotipy version: 2.19
  • your IDE (if using any)

Additional context
#794 might be the same issue

@xnetcat xnetcat added the bug label Apr 7, 2022
@jkulak
Copy link

jkulak commented Apr 15, 2022

I am getting the same errors in (what appears) random moments, and it started just recently. Using same code, same fast network. I am checking with Spotify API console just after the error occurs with same token and get data for the requested artist, album, track.

My observation is that 1/20 of the requests returns HTTP Error and next run of the code returns proper data.

Spotify's API status is not reporting any issues: https://status.spotify.dev/

@stephanebruckert
Copy link
Member

stephanebruckert commented Apr 15, 2022

It looks like this is an issue on the Spotify side rather than the spotipy Python library.

These seem related (please upvote them):

If anyone is up to create a new issue in Spotify for Developers gathering all the data, then we can all upvote it. Title could be something like "Getting 404 instead of 429/5xx"

In the meantime, I suggest you deal with retrying 404s in your code where you know it shouldn't fail. I know, it's just very bad that it returns 404 instead of 5xx or 429.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants