Files
get_rp/get_oorp.py
T

43 lines
963 B
Python

#!/bin/python3
from tkinter import *
from tkinter.font import Font
from PIL import Image
import requests
import urllib
class RP:
def __init__(self):
self.title
self.artist
self.album
self.year
self.time
self.jpg_path
def rp_refresh_API():
respons=requests.get("https://api.radioparadise.com/api/now_playing")
rp_dict=respons.json()
title=rp_dict["title"]
artist=rp_dict["artist"]
albun=rp_dict["album"]
year=rp_dict["year"]
time=rp_dict["time"]
jpg_path=rp_dict["cover"]
def store_albumcover():
rp_raw_image=requests.get(jpg_path).content
rp_file.open("album_art.jpg", "wb")
rp_file.close()
rp_convert_img=Image.open("album_art.jpg")
rp_convert_img.save("album_art.gif")
rp_convert_img.close()
def main():
pass
if __name__=="__main__":
main()