Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Spotipy current_user_playlists() only returns playlists that are on the public profile

I’m trying to access all the playlists from a user, the ones created, and followed, but when I use sp.current_user_playlists() it only gives me the playlists that have been added to public profile, when I removed them no playlists were returned.

Here is my code:

def getPlaylists():
    session[TOKEN_INFO], authorized = get_token()
    session.modified = True
    
    if not authorized:
        return redirect('/')
    sp = spotipy.Spotify(auth=session.get('token_info').get('access_token'))
    return sp.current_user_playlists()

and this is the auth I’m using:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

def create_oauth():
    return SpotifyOAuth(
        client_id=client_id,
        client_secret=client_secret,
        redirect_uri=url_for('redirectPage', _external=True),
        scope='playlist-read-private'
    )

>Solution :

You need to modify your create_oauth() function, this way:

def create_oauth():
    return SpotifyOAuth(
        client_id=client_id,
        client_secret=client_secret,
        redirect_uri=url_for('redirectPage', _external=True),
        scope='playlist-read-private playlist-read-collaborative'
    )
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading