yes.
This commit is contained in:
parent
6331b402a2
commit
c1b0447df6
1 changed files with 10 additions and 14 deletions
24
main.py
24
main.py
|
@ -9,8 +9,8 @@ import threading
|
||||||
import requests
|
import requests
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
import time
|
import time
|
||||||
#import urllib.request
|
|
||||||
import requests
|
import requests
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,13 +42,10 @@ def get_track():
|
||||||
track = sp.currently_playing()
|
track = sp.currently_playing()
|
||||||
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')
|
||||||
#urlretrieve(track['item']['album']['images'][0]['url'], 'thumbnail.jpg')
|
urlretrieve(track['item']['album']['images'][0]['url'], 'thumbnail.jpg')
|
||||||
#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 = Image.open('thumbnail.jpg')
|
||||||
print('downloading and opening image')
|
|
||||||
image = Image.open(requests.get(image_url, stream=True).raw)
|
|
||||||
#image = Image.open('thumbnail.jpg')
|
|
||||||
print('resizing image')
|
print('resizing image')
|
||||||
image = image.resize((32,32))
|
image = image.resize((32,32))
|
||||||
#return image
|
#return image
|
||||||
|
@ -75,13 +72,12 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print('started')
|
main()
|
||||||
main()
|
print('text')
|
||||||
print('text')
|
while True:
|
||||||
while True:
|
time.sleep(10)
|
||||||
time.sleep(10)
|
print('timed')
|
||||||
print('timed')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue