From e3185e22ecd79298cbb4f0d2680ad016e1d5df69 Mon Sep 17 00:00:00 2001 From: "Ryan K. Lee" Date: Mon, 15 Jul 2019 15:40:20 -0700 Subject: [PATCH] Update show_artist_top_tracks.py Import SpotifyClientCredentials from spotipy.oauth2 --- examples/show_artist_top_tracks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/show_artist_top_tracks.py b/examples/show_artist_top_tracks.py index a80beb8..68d8755 100644 --- a/examples/show_artist_top_tracks.py +++ b/examples/show_artist_top_tracks.py @@ -1,6 +1,7 @@ # shows artist info for a URN or URL import spotipy +from spotipy.oauth2 import SpotifyClientCredentials import sys import pprint @@ -9,7 +10,8 @@ if len(sys.argv) > 1: else: urn = 'spotify:artist:3jOstUTkEu2JkjvRdBA5Gu' -sp = spotipy.Spotify() +client_credentials_manager = SpotifyClientCredentials() +sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager) response = sp.artist_top_tracks(urn) for track in response['tracks']: