This commit is contained in:
Lukas Schulz 2020-12-20 20:10:54 +01:00
parent 905c750cc3
commit d79e41d5f4

View file

@ -62,12 +62,12 @@ def get_track():
sp = spotipy.Spotify(auth=token) sp = spotipy.Spotify(auth=token)
track = sp.currently_playing() track = sp.currently_playing()
if track is None: if track is None:
return return Image.new('RGB',(32,32),color='black')
global is_playing global is_playing
is_playing = track['is_playing'] is_playing = track['is_playing']
global song_name global song_name
if track is None: if track is None:
return return Image.new('RGB',(32,32),color='black')
song_name = track['item']['name'] song_name = track['item']['name']
global artist_name global artist_name
artist_name = track['item']['artists'][0]['name'] artist_name = track['item']['artists'][0]['name']