Download YouTube subtitles as SRT or VTT without downloading the video

With the Actor

curl -sS -X POST \
  "https://api.apify.com/v2/acts/codepulsehq~youtube-transcript-api/run-sync-get-dataset-items?token=${APIFY_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"videos": ["https://www.youtube.com/watch?v=UF8uR6Z6KLc"], "outputFormats": ["srt", "vtt"], "includeSegments": false}'

The result has srt and vtt fields containing the subtitle files as text. Save them as .srt / .vtt. The video is never downloaded.

Ready-made page: Download YouTube subtitles as SRT or WebVTT.

With yt-dlp

yt-dlp --skip-download --write-subs --write-auto-subs --sub-langs en --convert-subs srt "https://www.youtube.com/watch?v=UF8uR6Z6KLc"

(--convert-subs needs ffmpeg installed.)

Notes