spotcast: Access Token expired when trying to call spotify API
Indeed, it fails every hour, but it’s not exactly every 60 minutes.
2025-05-19 12:49:36.195 ERROR (SyncWorker_7) [spotipy.client] HTTP Error for GET to https://api.spotify.com/v1/me/tracks with Params: {'limit': 1, 'offset': 0, 'market': None} returned 401 due to The access token expired 2025-05-19 13:42:43.467 ERROR (SyncWorker_2) [spotipy.client] HTTP Error for GET to https://api.spotify.com/v1/me/playlists with Params: {'limit': 1, 'offset': 0} returned 401 due to The access token expired 2025-05-19 13:45:43.474 ERROR (SyncWorker_2) [spotipy.client] HTTP Error for GET to https://api.spotify.com/v1/me/tracks with Params: {'limit': 1, 'offset': 0, 'market': None} returned 401 due to The access token expired 2025-05-19 13:48:37.392 ERROR (SyncWorker_4) [spotipy.client] HTTP Error for GET to https://api.spotify.com/v1/me/playlists with Params: {'limit': 1, 'offset': 0} returned 401 due to The access token expired 2025-05-19 13:49:37.410 ERROR (SyncWorker_5) [spotipy.client] HTTP Error for GET to https://api.spotify.com/v1/me/tracks with Params: {'limit': 1, 'offset': 0, 'market': None} returned 401 due to The access token expired
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27
Hello, Still running without any error. That’s great! I think this one can be closed. Thank you.
build 14 released. Passing hassfest
@Mincka actually scratch that. I’ll have to make some tweaks, hassfest doesn’t like one of the string definition added for the fisrt validation step
looks a lot like the issue is with the public API. I’ll implement a tighter offset on the expiration just like I did for the desktop token
think I found the issue, I wrote
instead of
I was basically giving 10 minutes over the expiration time to the token, no wonder you kept having the issue.