This commit is contained in:
Lukas Schulz 2020-12-19 22:53:06 +01:00
parent 4a755f6661
commit 2943dd114d

View file

@ -41,10 +41,9 @@ def get_track():
print(track['is_playing'])
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 = BytesIO(url.read())
urlretrieve(track['item']['album']['images'][0]['url'], 'thumbnail.jpg')
#imageString = requests.get(track['item']['album']['images'][0]['url'])
image = Image.open(f)
image = Image.open('thumbnail.jpg')
print('resizing image')
image = image.resize((32,32))
#return image