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