yes.
This commit is contained in:
parent
5769fbe25f
commit
c506b7e872
1 changed files with 4 additions and 3 deletions
7
main.py
7
main.py
|
@ -39,10 +39,11 @@ 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:
|
image_url = track['item']['album']['images'][0]['url']
|
||||||
f = io.BytesIO(url.read())
|
response = requests.get(image_url)
|
||||||
|
imgage = Image.open(BytesIO(response.content))
|
||||||
#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(f)
|
||||||
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