[GH-ISSUE #292] playlist created by .user_playlist_create method is not returned by current_user_playlists #164

Closed
opened 2026-02-27 23:21:09 +03:00 by kerem · 1 comment
Owner

Originally created by @dannyt986 on GitHub (May 19, 2018).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/292

So Im trying to check if the playlist name already exists before creating a new playlist...

However although the playlist is visible in my desktop spotify app, it is not returned by the current_user_playlist method. Scope is 'playlist-modify-private'

But, if I use https://beta.developer.spotify.com/console/ to run the corresponding method I do see the playlist. I think this has something to do with scopes since the console also requires the 'playlist-read-collaborative' scope.

But then again, the created playlist is not a collaborative playlist... I cant test as it doesnt seem you can request multiple scopes using util.

        playlist_name = 'Running %s %d BPM' % (genre_input, tempo_input)
        existing_playlists = spotify.current_user_playlists(limit=50)
        for playlist in existing_playlists['items']:
            print(playlist['name']) #debugging visual listing of names
        if any(playlist_name in s for s in existing_playlists):
            already_exists = True
            # playlist_id = [id of playlist with name == playlist_name] 
        else:
            playlist_id = spotify.user_playlist_create(username, playlist_name, public=False)
            already_exists = False
        # wait_here = raw_input("Enter to finish...")
        spotify.user_playlist_add_tracks(username, playlist_id['id'], track_ids)
Originally created by @dannyt986 on GitHub (May 19, 2018). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/292 So Im trying to check if the playlist name already exists before creating a new playlist... However although the playlist is visible in my desktop spotify app, it is not returned by the current_user_playlist method. Scope is 'playlist-modify-private' But, if I use https://beta.developer.spotify.com/console/ to run the corresponding method I do see the playlist. I think this has something to do with scopes since the console also requires the 'playlist-read-collaborative' scope. But then again, the created playlist is not a collaborative playlist... I cant test as it doesnt seem you can request multiple scopes using util. ``` playlist_name = 'Running %s %d BPM' % (genre_input, tempo_input) existing_playlists = spotify.current_user_playlists(limit=50) for playlist in existing_playlists['items']: print(playlist['name']) #debugging visual listing of names if any(playlist_name in s for s in existing_playlists): already_exists = True # playlist_id = [id of playlist with name == playlist_name] else: playlist_id = spotify.user_playlist_create(username, playlist_name, public=False) already_exists = False # wait_here = raw_input("Enter to finish...") spotify.user_playlist_add_tracks(username, playlist_id['id'], track_ids) ```
kerem closed this issue 2026-02-27 23:21:09 +03:00
Author
Owner

@dannyt986 commented on GitHub (May 21, 2018):

idk but seems to be working today... closing issue for now....

<!-- gh-comment-id:390744994 --> @dannyt986 commented on GitHub (May 21, 2018): idk but seems to be working today... closing issue for now....
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#164
No description provided.