Gets current track from Spotify, gets the lyrics from Genius and outputs to a Flask app.
- spotipy - Used for getting current song data from Spotify; MAKE SURE YOU BUILD FROM SOURCE DON'T USE PACAKAGE MANAGER
- Requests - Required by spotipy
- LyricsGenius - Used for getting lyrics from Genius
- Flask
- Werkzeug
- Jinja2
- MarkupSafe - Comes with Jinja2
- ItsDangerous
- Click
- SimpleJSON - Used for reading the tokens file
The following set up guide is written under the assumption that you are using a Unix based shell. If not, I highly recommend you get one. I use Ubuntu through WSL (Windows Subsystem for Linux).
- Change the
usernamestring on line 16 of./spogen/lyrics.pyto your Spotify username.
Run sudo python3 setup.py install
At the moment, tokens must be manually added. Support for oAuth 2.0 is planned to be implemented soon.
- Duplicate
./tokens.dummy.jsonand rename it totokens.json. - Go to the Spotify Developer Dashboard and log in.
- Create a new app. Name it whatever, I called it
spotify-lyrics. Set the redirect URI tohttp://localhost/ - Now if you go into the app, you can get the client id and secret. You'll want to copy those into
tokens.json. Also set your redirect URI intokens.jsontohttp://localhost/as well. - Go to the Genius API Clients page and create an API client.
- For the app name, again doesn't really matter, but you should name it the same as the Spotify one. Set the "App Website URL" to
http://localhost/or the Github page. - Copy the client access token into
tokens.json.
To run, use . ./init.sh. If everything is set up correctly, it should work.
If the lyrics are inaccurate or completely wrong, you can manually set them by clicking the "No" button under the album art. This will create a textbox in which you can enter lyrics. Newlines will automatically be converted into HTML friendly <br> tags. The changes made are saved to the database.
- Beetlebum by Blur cannot be found even with name formatting, despite being on Genius.