From 4a755f66612a6405e48022c6d773d4a82a0e0a16 Mon Sep 17 00:00:00 2001 From: Lukas Schulz Date: Sat, 19 Dec 2020 22:51:17 +0100 Subject: [PATCH] yes. --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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')