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
|
||||
from io import BytesIO
|
||||
import time
|
||||
#import urllib.request
|
||||
import requests
|
||||
import shutil
|
||||
|
||||
|
||||
|
||||
|
@ -42,13 +42,10 @@ def get_track():
|
|||
track = sp.currently_playing()
|
||||
print(track['is_playing'])
|
||||
print(track['item']['name'] + ' - ' + track['item']['artists'][0]['name'])
|
||||
#print('getting image')
|
||||
#urlretrieve(track['item']['album']['images'][0]['url'], 'thumbnail.jpg')
|
||||
print('getting image')
|
||||
urlretrieve(track['item']['album']['images'][0]['url'], 'thumbnail.jpg')
|
||||
#imageString = requests.get(track['item']['album']['images'][0]['url'])
|
||||
image_url=track['item']['album']['images'][0]['url']
|
||||
print('downloading and opening image')
|
||||
image = Image.open(requests.get(image_url, stream=True).raw)
|
||||
#image = Image.open('thumbnail.jpg')
|
||||
image = Image.open('thumbnail.jpg')
|
||||
print('resizing image')
|
||||
image = image.resize((32,32))
|
||||
#return image
|
||||
|
@ -75,13 +72,12 @@ def main():
|
|||
|
||||
|
||||
|
||||
#if __name__ == "__main__":
|
||||
print('started')
|
||||
main()
|
||||
print('text')
|
||||
while True:
|
||||
time.sleep(10)
|
||||
print('timed')
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
print('text')
|
||||
while True:
|
||||
time.sleep(10)
|
||||
print('timed')
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue