Python project that updates metadata (including album art) and searches for lyrics from the Genius API.
Download the project or clone it with git. You can create a virtual environment if you can. Install the requisites by running
pip install -r requirements.txt
You will need to create an auth_token.txt
file in the Source
folder and paste a Genius token inside it.
You can generate a genius token here
Metadata.py
takes in an mp3 file (or a folder path) and searches for the corresponding metadata from Genius.com using the Genius API and Eyed3 module.
Here is an example in a test folder I made:
Run Metadata Search (collected from Genius.com):
Finished Search:
Updated mp3 file:
Metadata.py contains the funtcion get_metadata,
get_metadata(song_file, art_option=0)
Which is called with a file path to an mp3 file, and an optional art_option
which is set to 0 by default.
Setting art_option
to 0 will update the file with the songs Album Art,
Setting it to 1 will update the file to the songs Song Art, which sometimes differ.
GeniusLyrics.py
takes in a song name and artist name and searches Genius.com for the lyrics. The lyrics are saved to a json file called song_lyrics.json
. Searches are performed on this saved data when offline. Here is an example, running GUI.py
which is a simple gui for getting song lyrics
Example Search:
Output:
Take a look, run the code, and contribute if you'd like!