yes.
This commit is contained in:
parent
d7ad9584fb
commit
4a755f6661
1 changed files with 3 additions and 1 deletions
4
main.py
4
main.py
|
@ -9,6 +9,8 @@ import threading
|
||||||
import requests
|
import requests
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
import time
|
import time
|
||||||
|
import urllib.request
|
||||||
|
|
||||||
|
|
||||||
client_id = cfg.client_id
|
client_id = cfg.client_id
|
||||||
client_secret = cfg.client_secret
|
client_secret = cfg.client_secret
|
||||||
|
@ -40,7 +42,7 @@ def get_track():
|
||||||
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:
|
with urllib.request.urlopen(track['item']['album']['images'][0]['url']) as url:
|
||||||
f = io.BytesIO(url.read())
|
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(f)
|
||||||
print('resizing image')
|
print('resizing image')
|
||||||
|
|
Loading…
Reference in a new issue