diff --git a/main.py b/main.py index 337db98..c39fe71 100644 --- a/main.py +++ b/main.py @@ -9,6 +9,8 @@ import threading import requests from io import BytesIO import time +import urllib.request + client_id = cfg.client_id client_secret = cfg.client_secret @@ -40,7 +42,7 @@ def get_track(): print(track['item']['name'] + ' - ' + track['item']['artists'][0]['name']) print('getting image') 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']) image = Image.open(f) print('resizing image')