Socket
Socket
Sign inDemoInstall

spotify-lyrics-scraper

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    spotify-lyrics-scraper

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


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 for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your 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