mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #445] Server Error with next_track #260
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#260
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AphroMad on GitHub (Feb 25, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/445
Hi !
First, i wanted to say that i just love this python API so thank you so much guys for working on it !
Second, here is my problem, i try to use the next_track function and sometimes, there is this message :
SpotifyException: https://api.spotify.com/v1/me/player/next:
Server error.
When i click on the link of the error, there is this :
{ "error": { "status": 401, "message": "No token provided" } }Which i don't understand why because, here is the part of my code where i use the function
And you can see that there is a token.
The thing i don't understand is : sometimes it works perfectly, and then maybe 2 or 3 times later, even if i don't change my code, there is this error
Thank you for your future helping and your time !
Ps : Here is the code if you wanna try :
import spotipy
import spotipy.util as util
def connexion(username) :
user = "test" # fake name too
objet = connexion(user)
objet.next_track()
@KGB33 commented on GitHub (Feb 25, 2020):
Can you add your python traceback for the error? Does the error always occur on line 35 in that file?
@AphroMad commented on GitHub (Feb 25, 2020):
This is a part of a file, i the entire code, the line : objet.next_track() is 161 but yes, the error is always here
I tried to change next_track() by pause_playback() and some times there is an error too
here is the traceback :
Traceback (most recent call last):
File "", line 1, in
runfile('D:/Prog&Job/Business/En cours/Spotify Bot/Spotify_bot.py', wdir='D:/Prog&Job/Business/En cours/Spotify Bot')
File "C:\Users\pierr\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "C:\Users\pierr\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/Prog&Job/Business/En cours/Spotify Bot/Spotify_bot.py", line 161, in
objet.next_track()
File "C:\Users\pierr\Anaconda3\lib\site-packages\spotipy\client.py", line 1229, in next_track
return self._post(self._append_device_id("me/player/next", device_id))
File "C:\Users\pierr\Anaconda3\lib\site-packages\spotipy\client.py", line 227, in _post
return self._internal_call("POST", url, payload, kwargs)
File "C:\Users\pierr\Anaconda3\lib\site-packages\spotipy\client.py", line 173, in _internal_call
headers=r.headers,
SpotifyException: https://api.spotify.com/v1/me/player/next:
Server error.
@KGB33 commented on GitHub (Feb 25, 2020):
The code you've posted should work...
Maybe you are re-initializing "objet" without the token? Can you share the rest of your code via Pastebin?
@AphroMad commented on GitHub (Feb 25, 2020):
When i re-initialize "objet", i use the connexion function, and in this function i call the token...
i've to try an other to way to do it tonight, and i'll keep you in touch if the problem is still here !
but thanks anyway :)
@AphroMad commented on GitHub (Feb 26, 2020):
Theeeen, now it work but there is an other problem xD
i don't know if we can do it but is it possible to connect multiple accounts with the API ?
and if yes, how can i switch the action ?
Like, i want account A play this music et account B playing this one
Is this possible ?
@stephanebruckert commented on GitHub (Feb 26, 2020):
@AphroMad what did you change for it to work?
Answered your other question here https://github.com/plamere/spotipy/issues/446#issuecomment-591664527
@AphroMad commented on GitHub (Feb 27, 2020):
i think it was a problem of time
i tried to reconnect the account one time per 30 seconds
but if i try to reconnect only like 1 time per 3 minutes, it works
@stephanebruckert commented on GitHub (Feb 27, 2020):
Thanks for the feedback, but if it is still happening you should definitely report it on https://github.com/spotify/web-api/