Download Spotify Canvas videos (the looping clips behind songs) as MP4 or GIF.
git clone https://github.com/1lent/canvasgrab.git
cd canvasgrab
pip3 install -r requirements.txt
brew install ffmpeg # optional, for GIFs
sudo python3 canvasgrab.py --install # symlinks to /usr/local/bingit clone https://github.com/1lent/canvasgrab.git
cd canvasgrab
pip install -r requirements.txt
winget install ffmpeg # optional, for GIFscanvasgrab --sp-dc "<cookie>" # manual cookie (any platform)
canvasgrab # current Spotify track (macOS)
canvasgrab "spotify:track:3OHfY..." # any track by URI
canvasgrab "https://open.spotify.com/track/3OHfY..." # by share URL
canvasgrab --gif # also create a GIF
canvasgrab --open # open file after download
canvasgrab --verbose # debug API responsesFiles land in ~/canvasgrab/.
canvasgrab needs your Spotify sp_dc cookie. On macOS it auto-detects from Chrome, Brave, Edge, Firefox, Safari, Discord, or Cursor. On Windows, provide it manually:
- Go to open.spotify.com and log in
- Open DevTools (F12) → Application → Cookies →
open.spotify.com - Copy the value of the
sp_dccookie
Windows (PowerShell):
$env:SP_DC = "<your_cookie>"
python canvasgrab.py "spotify:track:3OHfY25tqY28d16oZczHc8"Windows (cmd — persistent):
setx SP_DC "<your_cookie>"macOS / Linux:
export SP_DC="<your_cookie>"
canvasgrabOr pass it inline on any platform:
canvasgrab --sp-dc "<your_cookie>" "spotify:track:3OHfY25tqY28d16oZczHc8"canvasgrab auto-detects your Spotify sp_dc cookie from Chrome, Brave, Edge, Firefox, Safari, Discord, or Cursor. On macOS it decrypts Chromium cookies via the Keychain. If no browser cookies exist, it falls back to the Spotify desktop app's LevelDB cache.
- Paxsenix0/Spotify-Canvas-API — protobuf schema, TOTP auth flow, and endpoint discovery
- Delitefully/spotify-canvas-downloader — original Python implementation and auth approach
- bartleyg/my-spotify-canvas — anonymous canvas token discovery
- xyloflake/spot-secrets-go — Spotify TOTP signing secret rotation
MIT

