yes.
This commit is contained in:
parent
4a755f6661
commit
2943dd114d
1 changed files with 2 additions and 3 deletions
5
main.py
5
main.py
|
@ -41,10 +41,9 @@ def get_track():
|
||||||
print(track['is_playing'])
|
print(track['is_playing'])
|
||||||
print(track['item']['name'] + ' - ' + track['item']['artists'][0]['name'])
|
print(track['item']['name'] + ' - ' + track['item']['artists'][0]['name'])
|
||||||
print('getting image')
|
print('getting image')
|
||||||
with urllib.request.urlopen(track['item']['album']['images'][0]['url']) as url:
|
urlretrieve(track['item']['album']['images'][0]['url'], 'thumbnail.jpg')
|
||||||
f = BytesIO(url.read())
|
|
||||||
#imageString = requests.get(track['item']['album']['images'][0]['url'])
|
#imageString = requests.get(track['item']['album']['images'][0]['url'])
|
||||||
image = Image.open(f)
|
image = Image.open('thumbnail.jpg')
|
||||||
print('resizing image')
|
print('resizing image')
|
||||||
image = image.resize((32,32))
|
image = image.resize((32,32))
|
||||||
#return image
|
#return image
|
||||||
|
|
Loading…
Reference in a new issue