def lyrics_minilyrics(artist, song): url = "" timed = False try: data = minilyrics.MiniLyrics(artist, song) for item in data: if item['url'].endswith(".lrc"): url = item['url'] break lyrics = requests.get(url, proxies=proxy).text timed = True except Exception: lyrics = error if url == "": lyrics = error if artist.lower().replace(" ", "") not in lyrics.lower().replace(" ", ""): lyrics = error timed = False return(lyrics, url, timed)
def _minilyrics(song): service_name = "Mini Lyrics" url = "" timed = False try: data = minilyrics.MiniLyrics(song.artist, song.name) for item in data: if item['url'].endswith(".lrc"): url = item['url'] break lyrics = requests.get(url, proxies=PROXY).text timed = True except Exception as error: print("%s: %s" % (service_name, error)) lyrics = ERROR if url == "": lyrics = ERROR if song.artist.lower().replace(" ", "") not in lyrics.lower().replace(" ", ""): lyrics = ERROR timed = False return lyrics, url, service_name, timed