This commit is contained in:
Lukas Schulz 2020-12-19 23:10:54 +01:00
parent 846673157b
commit 42b6f185ae

View file

@ -49,7 +49,9 @@ def get_track():
opener.addheaders=[('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1941.0 Safari/537.36')] opener.addheaders=[('User-Agent','Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1941.0 Safari/537.36')]
urllib.request.install_opener(opener) urllib.request.install_opener(opener)
filename = "thumbnail.jpg" filename = "thumbnail.jpg"
print('downloading image')
urllib.request.urlretrieve(image_url, filename) urllib.request.urlretrieve(image_url, filename)
print('opening image')
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))