mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #1088] Receiving authentication error when using "current_user_playlists" #643
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#643
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 @schebook on GitHub (Apr 24, 2024).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1088
Hi all,
As the title says, I'm receiving an authentication error when using the current_user_playlists method. I'm able to run the examples in the Spotipy docs - as I believe they don't require user authentication. A cache file is generated when I run the program with a bearer token as well.
I have the Client ID, Client Secret and Redirect URI set as environment variables. Not too sure where I'm going wrong. I'm not sure if I need to switch authentication methods, apply a certain scope, or something else. I've attempted to feed SpotifyClientCredentials() a scope to read private playlists to no avail. Any ideas? Below is my code:
and this is the error that I'm getting when trying to run:
@dieser-niko commented on GitHub (Apr 25, 2024):
You may want to replace
SpotifyClientCredentialswithSpotifyOAuthor the application will not have a user to work with. This also requires the addition of aSPOTIPY_REDIRECT_URI, but you won't get far without one either way.Also, I'm not sure how you got a JSON output. Normally it throws an error. If there are some additions to your script, make sure to include them if related.
@schebook commented on GitHub (Apr 25, 2024):
Thanks @dieser-niko ! Switching over to SpotifyOAuth allowed this to work. I got the JSON output via a link that was provided in the output. The link, when pasted into my browser, provided the JSON output. I think it's just Spotipy's way of creating an easier to read format.
@schebook commented on GitHub (Apr 25, 2024):
Using SpotifyOAuth fixed the issue that I was having. Make sure to have a redirect URI as mentioned by @dieser-niko