Socket
Socket
Sign inDemoInstall

spotify-lyrics-scraper

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Protect your apps from supply chain attacks

Install

spotify-lyrics-scraper

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

    1.2.2

Maintainers
1

Readme

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
  • Obtaining sp_key and sp_dc
  • Examples

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"))

FAQs


Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc