yes.
This commit is contained in:
parent
c76f5481de
commit
6331b402a2
1 changed files with 2 additions and 2 deletions
4
main.py
4
main.py
|
@ -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))
|
||||||
|
|
Loading…
Reference in a new issue