Code here

I really like to listen to music and have spent many hours editing metadata of my files to make sure it’s all correct, much of that effort going into making sure my files have the correct lyrics embedded on them, which many people don’t use, but I find immensely valuable.

Recently I’ve also changed from Windows to Linux, the music player I liked the most is cmus, but it lacked a feature I deem essential: Showing the lyrics of the song I’m playing, looking for plugins online I found some, but they were only good in looking for lyrics online, which is an issue both for songs not on the databases they fetch from and for when I am listening to music offline.

Using muthagen and pycmus I was able to quickly build something that could print the lyrics from the tags like I wished.

I then had what I wanted, but sometimes I’d listen to something and it would have no lyrics and changing back and forth between my script and either cmus-lyrics or clyrics (plugins that look for lyrics online) was bothersome, specially when changing between them did nothing because there was lyrics either on the file or online, so I started the second part: To make my script look up for lyrics online in the cases no lyrics was found in the file, for that I used used BeautifulSoap , and also made it so I could record the lyrics I found to the file if so I wished (not automatically to avoid adding the wrong lyrics to the file).

Maybe not too complex but I’m proud of myself for doing it and decided to share the script in case it’s useful for anyone else.

To use just run ./ on the folder you put the script on while Cmus is open.

Screenshot of the program working
Published 2021-12-27, edited at 2022-12-11