Want a useful tool that helps you find the lyrics to your favorite songs? Lyrics Scraper is here!
A python program that finds the lyrics of the song that is currently being played on user's Spotify's account.
Version 2.0 now supports a user-friendly GUI with a copy to clipboard feature!
Here's the quick rundown of what's really happening behind the scenes:
- Send request to Spotify's API to retrieve your LIVE playback data via Spotipy library
- After we have playback data, we will extract the fields necessary to get your lyrics
- We then use the extracted data to make our lyrics request to Genius API via LyricsGenius library
- Retrieve the lyrics from Genius and display it to you!
This project was made using Spotipy and LyricsGenius.
GUI component was made using TkInter. Please make sure you have a recent version of Python!
Refer to the installation guides provided by these links if you have any issues.
First install Spotipy via pip
pip install spotipy
Then install LyricsGenius via pip
.
lyricsgenius
requires Python 3.
pip install lyricsgenius
This program requires API keys from Spotify and Genius. Please contact me if you want a demo!
However, you can try and sign up for Spotify Developer Account and get your Spotify API key at https://developer.spotify.com/
and Genius token at https://genius.com/api-clients.
Then you can assign the variables config.client_id, config.client_secret, config.genius_token
with the keys you requested.
You run the script using:
python app.py
You will now be prompted with this window:
Start by pressing the 'Find lyrics' button.
If you're running it for the first time, it will open a new browswer tab and prompt you to log in.
Then you will need to grant access to your Spotify Account.
After that you can close the browser tab and navigate back to the application.
Play a song on Spotify and it will grab the lyrics!
Here I played Hall of Fame by The Scripts feat. will.i.am.
Snippet of output:
As you can see, it displayed:
- Song + artist(s) name
- The device the song is being played on
- The lyrics displayed in the text area
Want to share lyrics with your friends? The 'Copy to clipboard' feature can help you with that!
It will give you a warning that your clipboard content was cleared before the lyrics were pasted.
Enjoy :)