This commit is contained in:
Lukas Schulz 2020-12-20 01:18:03 +01:00
parent 4d1e277743
commit be96793022

View file

@ -39,7 +39,7 @@ token = util.prompt_for_user_token(username, scope, client_id, client_secret, re
font = ImageFont.load_default()
def get_track():
print('getting info')
#print('getting info')
sp = spotipy.Spotify(auth=token)
track = sp.currently_playing()
global is_playing
@ -48,8 +48,8 @@ def get_track():
song_name = track['item']['name']
global artist_name
artist_name = track['item']['artists'][0]['name']
print(track['item']['name'] + ' - ' + track['item']['artists'][0]['name'])
print('getting image')
#print(track['item']['name'] + ' - ' + track['item']['artists'][0]['name'])
#print('getting image')
image_url = track['item']['album']['images'][0]['url']
response = requests.get(image_url)
image = Image.open(BytesIO(response.content))