This commit is contained in:
Lukas Schulz 2020-12-19 22:51:17 +01:00
parent d7ad9584fb
commit 4a755f6661

View file

@ -9,6 +9,8 @@ import threading
import requests
from io import BytesIO
import time
import urllib.request
client_id = cfg.client_id
client_secret = cfg.client_secret
@ -40,7 +42,7 @@ def get_track():
print(track['item']['name'] + ' - ' + track['item']['artists'][0]['name'])
print('getting image')
with urllib.request.urlopen(track['item']['album']['images'][0]['url']) as url:
f = io.BytesIO(url.read())
f = BytesIO(url.read())
#imageString = requests.get(track['item']['album']['images'][0]['url'])
image = Image.open(f)
print('resizing image')