From 2943dd114d580bb3f4c6801829db24e62a19b976 Mon Sep 17 00:00:00 2001 From: Lukas Schulz Date: Sat, 19 Dec 2020 22:53:06 +0100 Subject: [PATCH] yes. --- main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index c39fe71..0605e09 100644 --- a/main.py +++ b/main.py @@ -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