Skip to main content

This allows you to grab Spotify lyrics from their API. You can input song names or track IDs. Supports proxies.

Project description

Spotify Lyrics Grabber

This Spotify Lyrics Grabber is a tool to grab Spotify Lyrics of any song, not just the one you are listening to.

Table of Contents

Installation

To install, run pip install spotify-lyrics-scraper in your command prompt. To import it, I recommend import spotify_lyrics_scraper as spotify

Obtaining

To obtain the sp_dc or sp_key:

  • Open a new Incognito Window in your browser. Head to https://accounts.spotify.com/en/login?continue=https:%2F%2Fopen.spotify.com%2F
  • Open Developer Tools (CTRL+SHIFT+I or F12) and head to the "Network" tab and make sure it is recording.
  • Login to Spotify.
  • Search/Filter for fraud or ?flow_ctx or masthead in the "Network" tab. (some of these may be patched, try others)
  • Under cookies for the request, you will see "sp_dc" and "sp_key".
  • Close the window WITHOUT LOGGING OUT (else said cookies will be made invalid).

Examples

Always using: import spotify_lyrics_scraper as spotify

Example 1
token = spotify.getToken("SP_DC Here")
print(spotify.getLyrics(token, songName="Song"))
Example 2 (Proxies)
token = spotify.getToken("SP_DC Here")
print(spotify.getLyrics(token, songName="Song", proxies={"https": "https://1.1.1.1:443"}))
Example 3 (Formatting)
token = spotify.getToken("SP_DC Here")
lyrics = spotify.getLyrics(token, songName="Song")
if type(lyrics) == spotify.spotifyDict: print(lyrics.formatLyrics()) # there are several modes, 0/none is just lyrics, 1 is starting time in ms, 2 is starting time in seconds
else: print(f"Error: {lyrics}")
Example 4 (sp_key)
token = spotify.getToken("SP_DC Here", "SP_Key Here") #SP Key can give you up to a year worth of spotify tokens.
print(spotify.getLyrics(token, songName="Song"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotify_lyrics_scraper-1.2.2.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

spotify_lyrics_scraper-1.2.2-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page