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
fraudor?flow_ctxormastheadin 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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spotify_lyrics_scraper-1.2.2.tar.gz.
File metadata
- Download URL: spotify_lyrics_scraper-1.2.2.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4e64ba8e0dfb2b4cf915aacf529a10f56ab0bc553e78de94b94a7f83dbd7b4d
|
|
| MD5 |
ad2fa5ec0cca26234c16203dd37e2362
|
|
| BLAKE2b-256 |
a96b1a1d993f8002903f5e94b23f24b03b34f62dddbda7158c204cb0ae7b669f
|
File details
Details for the file spotify_lyrics_scraper-1.2.2-py3-none-any.whl.
File metadata
- Download URL: spotify_lyrics_scraper-1.2.2-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfbc8a4e0ce9c14a68ab380bfabec215c0beb63c3c29bbb702dbbdf20f02c0f7
|
|
| MD5 |
b4e204d02008e0c8382e67c980ecfcf6
|
|
| BLAKE2b-256 |
6f5de2c4a46c09a6a36e89e354db73c4221d57c6b61b5a6eb65f15285224e920
|