Download the transcript of any Spotify podcast episode as Markdown, plain text, SRT subtitles or raw JSON.
Spotify generates transcripts for most podcasts and shows them under the Transcript tab, but the app does not let you select or copy the text. This tool fetches that same transcript, with chapter titles and speaker labels, and saves it as a file. Nothing is transcribed and no AI is involved: it is Spotify's own transcript, downloaded directly.
- One file, Python standard library only, no dependencies to install
- Works on macOS, Windows and Linux
- Double-click launcher for people who do not use a terminal
- Command line mode for scripting and batch downloads
- Login is asked for once and remembered on your computer only
- Python 3.8 or newer. macOS and most Linux systems already have it. On Windows install it from https://www.python.org/downloads/ and tick Add python.exe to PATH.
- A Spotify account (free is fine). Spotify only serves transcripts to logged-in users.
- Download this repository (green Code button, Download ZIP) and unzip it.
- Double-click the launcher for your system:
- macOS:
Spotify Transcript.command(if macOS refuses to open it, right-click, Open, or runchmod +x "Spotify Transcript.command"once) - Windows:
Spotify Transcript.bat - Linux:
spotify-transcript.sh
- macOS:
- A terminal window opens and asks you, in order:
- how to log in (see below)
- the episode links (paste one per line, empty line to start)
- where to save (default: your Downloads folder)
- the format (
mdMarkdown,txtplain text,srtsubtitles,jsonraw data)
- The transcript lands in the folder you chose, named
Show - Episode.md.
Your login and the folder/format you picked are remembered, so the next time you only paste links.
The script needs the sp_dc cookie from a browser where you are logged into https://open.spotify.com. Nothing else. Your password is never asked for or stored.
Option 1, automatic. If yt-dlp is installed, choose 1 and name your browser (chrome, firefox, safari, edge, brave, vivaldi, opera, chromium). The cookie is read from the browser profile. On macOS the system may ask for your keychain password once, that is the browser's cookie store being unlocked.
Option 2, paste it yourself.
- Open https://open.spotify.com in your browser and make sure you are logged in.
- Open the developer tools:
F12, orCmd+Option+Ion macOS. - Chrome / Edge / Brave: Application tab, left side Storage > Cookies >
https://open.spotify.com. Firefox: Storage tab > Cookies >https://open.spotify.com. Safari: enable the Develop menu in Settings > Advanced first, then Storage > Cookies. - Find the row named
sp_dcand copy its Value (a long string, about 200 characters). - Paste it when the script asks. The input is hidden, like a password.
The cookie is a login credential: it gives access to your Spotify account. It is stored only in ~/.config/spotify-transcript/config.json with owner-only permissions. Run python3 spotify_transcript.py --forget to delete it, or log out of Spotify in the browser to invalidate it. The cookie expires after about a year; the script tells you when it has gone stale.
python3 spotify_transcript.py URL [URL ...] # save to Downloads (or the remembered folder) as Markdown
python3 spotify_transcript.py URL -o ~/Desktop -f srt # choose folder and format
python3 spotify_transcript.py URL -t # add [m:ss] timestamps to each paragraph
python3 spotify_transcript.py URL --cookie SP_DC # one-off login without remembering it
python3 spotify_transcript.py URL --browser firefox # read the login from a browser (needs yt-dlp)
python3 spotify_transcript.py --login # interactive, re-do the login
python3 spotify_transcript.py --forget # delete the remembered login and settings
Links may be https://open.spotify.com/episode/ID, spotify:episode:ID, or just the 22 character id. The environment variable SPOTIFY_SP_DC is also honoured.
Exit codes: 0 success, 1 error, 2 at least one episode had no transcript.
Markdown (md): title, show, date, duration and link, then the transcript with Spotify's chapter titles as ## headings and speaker changes as **Speaker 1:** prefixes. Sentences are joined into paragraphs.
Plain text (txt): the same without markup.
SRT (srt): one subtitle cue per sentence with Spotify's own timing, speaker prefixed. Loads in any video player or subtitle editor.
JSON (json): the raw transcript as Spotify serves it, including per-word highlight timing.
Speaker labels are Spotify's (Speaker 1, Speaker 2); Spotify does not know the names. Episodes without a transcript on Spotify are reported and skipped. Music-only sections are omitted.
- Spotify's web player authenticates with a short-lived access token minted from your login cookie plus a time-based one-time code (TOTP) whose secret lives in the web player's JavaScript. The script reproduces that handshake:
GET open.spotify.com/api/server-time, thenGET open.spotify.com/api/token?...&totp=...&totpVer=...with thesp_dccookie. - With the token it calls
spclient.wg.spotify.com/transcript-read-along/v2/episode/<id>?format=json, the same endpoint the Transcript tab uses. - Episode metadata (title, show, date, duration) comes from the public embed page, no login needed.
- The JSON is rendered into the format you asked for.
Spotify rotates the TOTP secret every few months. The script carries the current secrets and refreshes them daily from CycloneAddons/spotify-token-generator. If the handshake ever fails for every version, that list needs an update: open an issue here.
python3 -m unittest discover -s tests -v
The tests are offline and cover link parsing, the TOTP algorithm, and all renderers against a fixture built from a real transcript.
- This is an unofficial tool that uses the web player's private endpoints. It may stop working if Spotify changes them.
- Use it with your own account, for your own reading. Transcripts belong to the podcast's rights holders.
- No data leaves your computer except the requests to Spotify (and one to GitHub for the secret list).
MIT