mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #513] Can't perform authorization, SET is invalid on Windows #308
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#308
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 @janecafe on GitHub (Jun 15, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/513
Hi,
I am trying to authorize the Spotipy API and it is not working. I have the following (removed sensitive data)
The above way, I get invalid syntax. The more straightforward way below also does not work:
@stephanebruckert commented on GitHub (Jun 15, 2020):
Hi @jane-dempsey,
There might be a mistake in the doc, can you try
setinstead ofSET?About the error with
util.prompt_for_user_token, can you please describe it? cheers@janecafe commented on GitHub (Jun 15, 2020):
Thanks for chiming in!
I have tried both set and SET.
For the second batch of code utilizing util -- when I run it, a new page pops it. I get this error:
Regardless, I post the URL of this page in the text box that pops up in my IDE (Jupyter Notebook).
I tried authorizing around a year ago, and recall with some attempts a page would pop up via Spotify Developer asking me to authorize. In other cases, just this error page would pop up.
In my current attempts, when I get this localhost error, I post the URL in the textbox but when I try other things it says my client ID is missing and needs to be authorized.
The current redirect URIs in my Spotify Developer page are http://localhost:1410/ and http://localhost/ -- I have tried both.
@stephanebruckert commented on GitHub (Jun 15, 2020):
Hmm I'm really not sure why
setwouldn't work. Can you enter justsetalone and see if they appear in the list?I think this message is expected. At this point you should copy the URL and paste it into your terminal.
However, there is a way to do that automatically by using a port (as opposed to using simply
localhost. See https://spotipy.readthedocs.io/en/2.12.0/#redirect-uri@janecafe commented on GitHub (Jun 15, 2020):
When I try
set SPOTIPY_CLIENT_ID='myclientid'I get a Syntax error.
Also, I did paste the URL in the terminal as I've typically been doing. When I try to perform other tasks, I get the error message in my IDE:
No matter how many times I try to authorize, I get a notice saying there is no token :(
@stephanebruckert commented on GitHub (Jun 15, 2020):
What is the exact syntax error when using
set?Are you running this from the Windows command line?
Are you running it with or without single quotes? if one does not work, I would try the other one
Also please share your full code. This 401 error message is often seen if the token was not passed to Spotify(), such as:
@janecafe commented on GitHub (Jun 15, 2020):
See below, I removed my personal data like my username, client id, client secret.
I am doing this work in Jupyter Notebook IDE, it is my understanding this is fine.
Before I go to my current full code, separate to that is the error I get with set:
SET SPOTIPY_CLIENT_ID='MYCLIENTID'error message:
That was from a previous attempt so I currently am trying with no set, see below:
When I implement the token, a new Google Chrome page pops up with this error:
I then paste the URL in the IDE -- a text box appears asking me to fill in the URL. Here is the output:
Then, when I try this simple piece of code:
I get this error:
@stephanebruckert commented on GitHub (Jun 15, 2020):
spotipy.Spotify()you should actually dospotipy.Spotify(auth=token)@janecafe commented on GitHub (Jun 17, 2020):
It works! Thank you so much for all of your help!