DEV Community

How to download a YouTube transcript as TXT, SRT, or VTT - the manual ways first

YouTube shows a transcript for most videos, but it doesn't give you a download button. Here are the ways that actually work, in order of effort.

1. The built-in transcript panel (copy-paste)

Open a video, expand the description, click "Show transcript". You get a scrolling list of timestamped lines.

You can select and copy it - but you get the timestamps inline, no file, and only the rows YouTube has rendered so far.

On the video I measured (dQw4w9WgXcQ, Rick Astley's "Never Gonna Give You Up"), the panel rendered 24 segments, 2,066 characters. That's the first screenful, not the whole video.

2. The timedtext endpoint (if your IP cooperates)

The video page embeds a list of caption tracks. Each track has a timedtext URL that returns the full transcript in formats like json3, srv3, ttml, or vtt. Append &fmt=json3 (or srv3) and fetch it.

One caveat I measured, not guessed: from a datacenter IP, that endpoint returns HTTP 200 with an empty body - every format, json3 through srv3. curl got 0 bytes, then 429s on repeated requests. The same request inside a real browser on the same network also came back empty.

From a residential IP it is expected to work, but I couldn't verify that from my environment, so I won't claim it.

3. The panel DOM changed (a note for anyone scripting this)

If you wrote a scraper against the old transcript DOM, it silently returns zero rows now. The old selector ytd-transcript-segment-renderer matches nothing on current YouTube.

The current rendering uses <transcript-segment-view-model>, with timestamps in .ytwTranscriptSegmentViewModelTimestamp and text in span[role="text"].

I verified this on the same video: the new selectors return the 24 segments; the old one returns 0. If your tool stopped working recently, this is probably why. The fix is to try the new DOM first and fall back to the old one.

4. What I'm building

I'm building a small Edge/Firefox extension, YouTube Transcript Export, that reads the panel and exports the transcript as TXT, Markdown, SRT, or VTT.

On the measured video it produced all four formats from the same 24 cues:

  • TXT 2,335 bytes
  • Markdown 2,668
  • SRT 3,142
  • VTT 3,162

Test suite: 120 checks passing. It runs entirely locally - no account, no server.

Status, stated plainly: it is in review on Edge Add-ons, not installable yet. The Pro tier (playlist batch export, bilingual side-by-side) is planned at ¥19.90 one-time and is not for sale.

Privacy policy: https://alapha888.github.io/yt-transcript-export-privacy/

If you just need one transcript today, method 1 works. If you need a file, method 2 works from a normal home connection. Method 3 is the warning if you're automating it.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.