Laurent-Andrieu/Spotify-Lyrics
Python script showing the lyrics from the current song being played on Spotify
Spotify-Lyrics
This python script allows you to see the lyrics of your current playing song on Spotify.
Clone the repository
Windows Users
- Download & Install Git Bash
Linux Users
- Type
sudo apt install giton your terminal
After Git installation type git clone https://github.com/Laurent-Andrieu/Spotify-Lyrics/ to clone the repository.
Requirements
Python Version 3.8
Spotipy Version 2.12.0
- Type
pip install spotipy --upgradein your terminal
Gecko driver
For windows users:
Visual studio
Create your spotify app
Developer portal
Log in the Developer portal with your account and create and app.
Once created, go to EDIT SETTINGS > Redirect URIs and add any link to your local machine, targetting any free port (eg : https://localhost:8000)
Use Spotify-Lyrics
Run.py
To run the program, simply call this file. Before you run it, make sure you add your Profile ID, your CLIENT_ID and CLIENT_SECRET from the Developer portal.
You can find your Profile ID by going to your account on the Spotify App and click on ... > Share > Copy the Spotify URI. (eg : spotify:user:213tzif5o7rzyxtijuqdgtfuq)
Spotify.py
This program contains the SetCreditential Class witch will add your IDs in environement variables passed by the Connexion Class.
The Connexion Class performs the connexion throught the Authorization Code Flow authentification method via the get_token() function.
It also allows you to call the track_data() function to retrive the author and name of the song being played.
Driver.py
Scrapes Genius for the song returned by Spotify.Connexion().track_data(). Also requires the full path of your gecko driver to work.
Searches for the song's 'mini card' and returns its href.
Call start_driver() and window_handle() to start the browser and to handle closing errors.
Call search() to get the link and then call browse() to open that page.
Lyrics.py
Searches for the lyrics of the song.
Returns the lyrics in plain text format.
Initiate an object with Find class by passing it the href. Then call print_ or store Find.lyrics to get the result.
Future immplements
-
Terminal.py: Lyrics display. Prints the lyrics on a terminal. -
View.py: GUI. Allows the user to see the lyrics on an python based small application. -
Higlight.py: Current lyrics higlighting. Highlights the lyrics in realtime.
Commit info
| Author | Date | Improvements |
|---|---|---|
| Laurent Andrieu | Jun 05 2020 16:32pm | - [x] README.md |
| - [x] Version 2 repository | ||
- [x] Lyrics.py |
||
- [x] Driver.py |
||
- [x] Run.py |
