By Using this requirements, we have to write three functions to search, get and set the lyrics.
First Function to search lyrics, to search lyrics we have to use https://rclyricsband.com/?s= this site. It is the source of all lyrics. Send requests to this site using request and scrape it using BeautifulSoup4.
search_link="https://rclyricsband.com/?s="defsearch_lyrics(song_name:str,one=True):print(f"Searching for {song_name}")markup=requests.get(search_link+quote_plus(song_name)).textsoup=BeautifulSoup(markup,"html.parser")outer_tags=soup.find_all("h2",{"class":"search-entry-title"})results=[]forouter_taginouter_tags:inner_tag=outer_tag.find("a")results.append({"title":inner_tag.get("title"),"link":inner_tag.get("href")})iflen(results)==0:returnNoneifone:print(f"Found Best Match: {results[0]['title']}")returnresults[0]else:results
This function search the lyrics and return the first result which contain title of the song and link to lyrics
Second function to get the lyrics using the link from the first function
A command line lyrics utility tool which search and add lyrics to your offline songs. 🎵
🎼 lyricy
A command line lyrics utility tool which search and add lyrics to your offline songs.
Why lyricy ?
We can use spotDL/spotify-downloader to download our spotify playlist and songs along with album art and metadata. But it does not add the lyrics of the songs in song metadata. lyricy search for the lyrics of the song add to song metadata.
you can use Retro music player for android to listen the offline local songs with synced lyrics.
Features
Used as a Python package, Desktop application and mobile application (PWA)