[Python] Spotipy (python) functions run forever with OAuth

Discussão em 'Python' iniciado por Stack, Dezembro 9, 2024.

  1. Stack

    Stack Membro Participativo

    import requests
    import json
    import spotipy
    from credentials import CLIENT_ID, CLIENT_SECRET, REDIRECT_URI
    from spotipy.oauth2 import SpotifyOAuth


    # auth
    print('starting auth')
    sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id=CLIENT_ID, redirect_uri=REDIRECT_URI, client_secret=CLIENT_SECRET, scope='playlist-modify-public user-library-read'))
    print('finished auth')

    taylor_uri = 'spotify:artist:06HL4z0CvFAxyc27GXpf02'

    print('searching')
    results = sp.artist_albums(taylor_uri, album_type='album')
    print('done searching')
    albums = results['items']
    while results['next']:
    results = sp.next(results)
    albums.extend(results['items'])

    for album in albums:
    print(album['name'])


    results = sp.artist_albums(taylor_uri, album_type='album')


    the line above leaves the code hanging, i have tried many other functions but will just load forever...

    [​IMG]

    Continue reading...

Compartilhe esta Página