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
?flow_id
in the "Network" tab. - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for spotify_lyrics_scraper-1.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aea53166caba7ae03def6f881d8e9c09c73f7f9b70b60067bf335e28f1231198 |
|
MD5 | 152cde856f86e78847dddeb595924fde |
|
BLAKE2b-256 | 126a0dce7155059204195b469fc6171158b6677d28121d6225b01a78cad08b95 |
Close
Hashes for spotify_lyrics_scraper-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e4d29cac7641a4bb0dacf68e50921f7bb266f983bd868c6b71ef079afde591e |
|
MD5 | bddc743a7dd63d37dbdd10012f9a1c2a |
|
BLAKE2b-256 | af871405e385040d4d814088a835f54c0475ebf46270c6f0d295da00898d64de |