mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #306] Error with tokens #175
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#175
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 @theerfan on GitHub (Jul 3, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/306
Hi, I'm trying to manually add some albums to my saved ones, but I keep getting this error with a link that leads me to a page with some JSON code which says "no token provided", I think I have read the doc carefully enough, but I'm still unable to figure out the problem.
[I have already done the first authorization thing where you have to give the program a link before starting everything.]
Thanks in advance.
@brobotic commented on GitHub (Jul 4, 2018):
What version of spotipy & python are you using?
Having trouble reproducing this with your code. I created a new test app using your settings (same scope and redirect_uri) and successfully added an album to my saved music.
Still new myself, but the only thing that seems off to me is the line where you define your token. The documentation states that prompt_for_user_token's first argument is simply your username and not 'username=username'. Perhaps try changing that line to that? Like this:
token = spotipy.util.prompt_for_user_token(username, scope=access, client_id=clientID, client_secret=clientSecret, redirect_uri=redirectURL)@theerfan commented on GitHub (Jul 5, 2018):
Python 3.6.5 and Spotipy 2.4.4
Changed the line but I'm still getting the same link as before.
P.S: Could the fact that I have to use a VPN (and am while running this code) in order to use spotify have something to do with this?
P.S.2: It's really weird, I can retrieve my saved track (by changing the scope of course) easily, but only when I try to modify something, this happens.
@brobotic commented on GitHub (Jul 7, 2018):
Very odd indeed.
The VPN could be a factor, but I guess that would depend on the type of VPN and its configuration. spotipy is just opening https://accounts.spotify.com/authorize (along with some additional parameters in the URL) in your browser, and then their service will redirect you to whatever redirect_uri you set in your app configuration in the Developer portal on Spotify's website. Since you are using http://localhost/, I'm not terribly convinced that the VPN would interfere. With that said, hard to say if that's the issue.
Wish I could be of more help but I don't have any sort of VPN to test with / don't know which service you are using for that.
Edit: for the sake of testing, what if you changed the redirect_uri in your app's settings on Spotify's site? Something with a different port. Like: http://localhost:8888/callback
@stephanebruckert commented on GitHub (Jan 13, 2020):
@theerfan you are currently using both authentication flows at the same time. To use the token and access your spotify profile data, you need to use the token while getting rid of the
client_credentials_manager.So change this:
to:
Read about it here https://spotipy.readthedocs.io/en/2.6.1/#authorization-code-flow