yes.
This commit is contained in:
parent
622a652c53
commit
d7ad9584fb
1 changed files with 5 additions and 3 deletions
8
main.py
8
main.py
|
@ -39,14 +39,16 @@ 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')
|
||||||
imageString = requests.get(track['item']['album']['images'][0]['url'])
|
with urllib.request.urlopen(track['item']['album']['images'][0]['url']) as url:
|
||||||
image = Image.open(BytesIO(imageString.content))
|
f = io.BytesIO(url.read())
|
||||||
|
#imageString = requests.get(track['item']['album']['images'][0]['url'])
|
||||||
|
image = Image.open(f)
|
||||||
print('resizing image')
|
print('resizing image')
|
||||||
image = image.resize((32,32))
|
image = image.resize((32,32))
|
||||||
#return image
|
#return image
|
||||||
#image.save("thumbnail.jpg","JPEG")
|
#image.save("thumbnail.jpg","JPEG")
|
||||||
print('set image')
|
print('set image')
|
||||||
screen.SetImage(thumbnail.convert('RGB'))
|
screen.SetImage(image.convert('RGB'))
|
||||||
print('image set')
|
print('image set')
|
||||||
|
|
||||||
#if token:
|
#if token:
|
||||||
|
|
Loading…
Reference in a new issue