Skip to content

Python program that uses Spotipy and LyricsGenius libraries to find the lyrics of the currently playing song on Spotify via a user-friendly GUI.

Notifications You must be signed in to change notification settings

ltdatphan/lyrics-scraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Want a useful tool that helps you find the lyrics to your favorite songs? Lyrics Scraper is here!

Lyrics Scraper

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!

How does it work exactly?

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!

Installation

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.

Quick guide:

First install Spotipy via pip

pip install spotipy

Then install LyricsGenius via pip.
lyricsgenius requires Python 3.

pip install lyricsgenius

API key requirement

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.

Usage

You run the script using:

python app.py

You will now be prompted with this window:

image

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.

image
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:
image

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

New feature!

Want to share lyrics with your friends? The 'Copy to clipboard' feature can help you with that! image

It will give you a warning that your clipboard content was cleared before the lyrics were pasted.

Enjoy :)

About

Python program that uses Spotipy and LyricsGenius libraries to find the lyrics of the currently playing song on Spotify via a user-friendly GUI.

Topics

Resources

Stars

Watchers

Forks

Languages