This commit is contained in:
Lukas Schulz 2020-12-19 23:22:58 +01:00
parent c76f5481de
commit 6331b402a2

View file

@ -10,7 +10,7 @@ import requests
from io import BytesIO from io import BytesIO
import time import time
#import urllib.request #import urllib.request
import urllib2 import requests
@ -47,7 +47,7 @@ def get_track():
#imageString = requests.get(track['item']['album']['images'][0]['url']) #imageString = requests.get(track['item']['album']['images'][0]['url'])
image_url=track['item']['album']['images'][0]['url'] image_url=track['item']['album']['images'][0]['url']
print('downloading and opening image') print('downloading and opening image')
image = Image.open(urllib2.urlopen(image_url)) image = Image.open(requests.get(image_url, stream=True).raw)
#image = Image.open('thumbnail.jpg') #image = Image.open('thumbnail.jpg')
print('resizing image') print('resizing image')
image = image.resize((32,32)) image = image.resize((32,32))