mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 08:05:55 +03:00
[GH-ISSUE #792] Using util.prompt_for_user_token on a headless machine, can't use open_browser=False? #490
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#490
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 @kingofsquirrel on GitHub (Mar 20, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/792
Okay, so I've recently moved on to a Raspberry Pi although whenever I try to use Spotipy it gets stuck.
I figured out that the problem is that normally, a browser window would open so I can authenticate my program.
I'm now working on a headless machine so it of course doesn't work.
There has been an issue like this before and it was said that there was the variable open_browser added, which is exactly what I'm looking for.
Although with my method of authorisation, I can't use open browser?
The only pieces of code I have are
token = util.prompt_for_user_token(username=username,scope=scope, client_id=client_id_spotify, client_secret=client_secret_spotify, redirect_uri=redirect_uri)and then
sp = spotipy.Spotify(auth=token)The problem is that open_browser can't be used with util, and I have no idea how to get it working.
@stephanebruckert commented on GitHub (Dec 7, 2022):
spotipy.util.prompt_for_user_token()is deprecated and it is now recommended to use:See https://github.com/spotipy-dev/spotipy/blob/master/examples/headless.py for an example