diff --git a/examples/simple3.py b/examples/simple3.py index 96f300a..929c899 100644 --- a/examples/simple3.py +++ b/examples/simple3.py @@ -1,14 +1,16 @@ import spotipy +from spotipy.oauth2 import SpotifyClientCredentials import sys -spotify = spotipy.Spotify() +client_credentials_manager = SpotifyClientCredentials() +sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager) if len(sys.argv) > 1: name = ' '.join(sys.argv[1:]) else: name = 'Radiohead' -results = spotify.search(q='artist:' + name, type='artist') +results = sp.search(q='artist:' + name, type='artist') items = results['artists']['items'] if len(items) > 0: artist = items[0]