mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #328] sp.next_track() : Not available for the current user #188
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#188
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 @AlessandroMinervini on GitHub (Oct 9, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/328
Hi everyone,
i'm implementing a simple application with spotipy.
I want skip to the next track or pause, but i've this error in output:
spotipy.client.SpotifyException: http status: 403, code:-1 - https://api.spotify.com/v1/me/player/next:
Not available for the current user
My code is here:
`import os
import spotipy
import spotipy.util as util
from json.decoder import JSONDecodeError
username = 'myUserCode'
client_id = 'xxxxxxxxxxxx'
client_secret = 'xxxxxxxxxxxxx'
redirect_uri = 'https://www.xxxx.com/'
scope = 'user-modify-playback-state'
try:
token = util.prompt_for_user_token(username, scope, client_id, client_secret, redirect_uri)
except (AttributeError, JSONDecodeError):
os.remove(f".cache-{username}")
token = util.prompt_for_user_token(username, scope, client_id, client_secret, redirect_uri)
sp = spotipy.Spotify(auth=token)
current = sp.next_track()`
@qqrs commented on GitHub (Oct 11, 2018):
@AlessandroMinervini
One thing you might check:
https://developer.spotify.com/documentation/web-api/reference/player/skip-users-playback-to-next-track/