Working text and album_art.
Now needs some refactoring and cleaning
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 146 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 21 KiB |
@@ -17,7 +17,7 @@ def get_rp():
|
|||||||
album = tekst["album"]
|
album = tekst["album"]
|
||||||
year = tekst["year"]
|
year = tekst["year"]
|
||||||
time = tekst["time"]
|
time = tekst["time"]
|
||||||
jpg_path = tekst["cover_med"]
|
jpg_path = tekst["cover"]
|
||||||
|
|
||||||
# Return caller standard information
|
# Return caller standard information
|
||||||
message = (f'Titel: {title}\nArtiest: {artist}\nAlbum: {album}\nJaar: {year}\nTijd: {time}')
|
message = (f'Titel: {title}\nArtiest: {artist}\nAlbum: {album}\nJaar: {year}\nTijd: {time}')
|
||||||
@@ -30,6 +30,20 @@ def rp_refresh():
|
|||||||
rp_tekstbox.delete("1.0", "end")
|
rp_tekstbox.delete("1.0", "end")
|
||||||
rp_tekstbox.insert("1.0", get_rp()[0])
|
rp_tekstbox.insert("1.0", get_rp()[0])
|
||||||
|
|
||||||
|
rp_image_path = get_rp()[1]
|
||||||
|
rp_image_file = requests.get(rp_image_path).content
|
||||||
|
|
||||||
|
rp_file=open("album_art.jpg", 'wb')
|
||||||
|
rp_file.write(rp_image_file)
|
||||||
|
rp_file.close()
|
||||||
|
rp_image = Image.open("album_art.jpg")
|
||||||
|
rp_image.save("album_art.gif")
|
||||||
|
rp_image.close()
|
||||||
|
|
||||||
|
img = PhotoImage(file="album_art.gif", format='gif')
|
||||||
|
image_lbl.configure(image=img)
|
||||||
|
image_lbl.image=img
|
||||||
|
|
||||||
if __name__=="__main__":
|
if __name__=="__main__":
|
||||||
|
|
||||||
window=Tk()
|
window=Tk()
|
||||||
@@ -48,17 +62,16 @@ if __name__=="__main__":
|
|||||||
rp_tekstbox.pack()
|
rp_tekstbox.pack()
|
||||||
|
|
||||||
rp_image_path = get_rp()[1]
|
rp_image_path = get_rp()[1]
|
||||||
# print(rp_image_path) ## DEBUG werkt!
|
|
||||||
rp_image_file = requests.get(rp_image_path).content
|
rp_image_file = requests.get(rp_image_path).content
|
||||||
# print(rp_image_file) ## DEBUG werkt!
|
|
||||||
|
|
||||||
rp_file=open("album_art.jpg", 'wb')
|
rp_file=open("album_art.jpg", 'wb')
|
||||||
rp_file.write(rp_image_file)
|
rp_file.write(rp_image_file)
|
||||||
rp_file.close()
|
rp_file.close()
|
||||||
rp_image = Image.open("album_art.jpg")
|
rp_image = Image.open("album_art.jpg")
|
||||||
rp_image.save("album_art.gif")
|
rp_image.save("album_art.gif")
|
||||||
|
rp_image.close()
|
||||||
|
|
||||||
img = PhotoImage(file='album_art.gif', format='gif')
|
img = PhotoImage(file="album_art.gif", format='gif')
|
||||||
image_lbl = Label(window, image=img)
|
image_lbl = Label(window, image=img)
|
||||||
image_lbl.pack()
|
image_lbl.pack()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user