The script will get your currently playing song on Spotify and automatically grab the lyrics.
Â
pip3 install -r requirements.txt
Â
To use this program, you will need to get the
SP_DC
andSP_KEY
cookie values.
To obtain the cookies (valid for 1 year):
- Open a new Incognito window in Chrome (or another browser) at https://accounts.spotify.com/en/login?continue=https:%2F%2Fopen.spotify.com%2F
- Open Developer Tools in your browser (might require developer menu to be enabled in some browsers)
- Login to Spotify.
- Search/Filter for get_access_token in Developer tools under Network.
- Under cookies for the request save the values for
sp_dc
andsp_key
. - Close the window without logging out (Otherwise the cookies are made invalid).
Â
Export your Spotify Username and PW as environment variables and then start the script. e.g.
export SP_DC="abcxyz"
export SP_KEY="abcxyz"
python3 spotifylyrics.py
Â
Originally forked from https://github.com/PappaStalin/Spotify-Lyrics
I have refactored code to my tastes, including switching to use the simpler oauth mechanism / removing dependency on Spotipy and HTTP servers, which caused a tricky setup process.