mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #484] 'User_Playlist_Create' is throwing the '403' error #285
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#285
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 @jboss10 on GitHub (Apr 27, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/484
Hi Guys -
Maybe I'm doing something wrong but I successfully created authorization/authentication and can pull and parse songs/album from (2) test playlists I created. However, I'm not able to create a playlist?
Error I'm seeing:
ERROR:spotipy.client:HTTP Error for POST to https://api.spotify.com/v1/users/MYUSRNAME/playlists returned 403 due to You cannot create a playlist for another user.
Traceback (most recent call last):
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.spotify.com/v1/users/MYUSRNAME/playlists
Why is it telling me I'm attempting to create a playlist for another user?
Here is my authorization routine. Also note, I've changed the scope to 'private' and 'public' with no success. I added the 'user_playlist_create' routine in this method just as a test and still fails.
@stephanebruckert commented on GitHub (Apr 27, 2020):
In your browser, your connected spotify user is probably not the same one as
self.usrName. To change user, addshow_dialog=Trueas suggested here https://github.com/plamere/spotipy/issues/451#issuecomment-597794047.Then, check that
sp.me()returns the correct user, see https://github.com/plamere/spotipy/issues/464#issuecomment-609411128@jboss10 commented on GitHub (Apr 27, 2020):
Great, I’ll give it a shot and report back. Thanks a bunch!
Why does the
self.usrNamework when getting the songs from my playlist? Just curious.@ritiek commented on GitHub (Apr 27, 2020):
I'm assuming you're using the methods
Spotify.user_playlistorSpotify.user_playlist_tracks. That's probably because Spotify removed the necessity of passing the username for fetching playlists some time ago. See #335. You could pass any username (orNone) and it should still work.spotipy hasn't omitted the
userparameter from existing methods yet since this change wouldn't be backwards compatible with older spotipy versions. You could however use the newer methodsSpotify.playlistandSpotify.playlist_trackswhich do not require theuserparameter.@jboss10 commented on GitHub (Apr 27, 2020):
Yes, 100% that's what it was. Looks like I was trying to connect to my personal account and not my test environment. DUH!
This is a project so could someone run into this issue when running/testing my script? If so, how to avoid from them using their own personal sign-in?
Thanks!
@jboss10 commented on GitHub (Apr 27, 2020):
Ah, OK - great! Thanks so much!