Spotify - BluDood/BluDoodAPI GitHub Wiki
Setting up environment variables for Spotify
If you would like to enable the /spotify
and /ws
endpoints, you'll have to do some steps to set them up.
Steps
sp_dc
cookie
Getting your This is required to get a "user" token, which is needed for live fetching of player status.
- Open https://open.spotify.com and log in if you haven't already
- Open DevTools in your browser (usually CTRL+SHIFT+I)
- Go to
Storage
(Firefox), orApplication
(Chrome/derivatives) - Go to
Cookies
,https://open.spotify.com
, and search upsp_dc
- Copy the value
Configure the environment variables
Once you've retreived your sp_dc
cookie, put it in your .env
file like so:
SPOTIFY_DC=your_cookie
Restart the API if it's already running, and the /spotify
endpoint should be available! You can also now get live updates by listening to the /ws
WebSocket endpoint.