Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
Last active May 31, 2026 23:14
Show Gist options
  • Select an option

  • Save barseghyanartur/43ac4b08ecc729cda15f7d4487241efd to your computer and use it in GitHub Desktop.

Select an option

Save barseghyanartur/43ac4b08ecc729cda15f7d4487241efd to your computer and use it in GitHub Desktop.
blog: Grab YouTube subtitles with `yt-dlp`

Grab YouTube subtitles with yt-dlp

Date: 2026-06-01 01:05
category:Tech
tags:yt-dlp, youtube, subtitles, cli
summary:A one-liner to download auto-generated subtitles from YouTube as SRT files without touching the video.

Sometimes you need subtitles — for a transcript, for translation, for feeding into some other tool — but you don't want the video itself. yt-dlp handles this cleanly.

One command does it:

yt-dlp --write-auto-sub --convert-subs=srt --skip-download 'https://www.youtube.com/watch?v=uniqueVideoID'

What each flag does:

  • --write-auto-sub — fetch the auto-generated subtitle track (the one YouTube generates automatically, not the manually uploaded captions)
  • --convert-subs=srt — convert whatever format YouTube spits out (usually VTT) into the widely-supported SRT format
  • --skip-download — don't download the video, just the subtitles

The result is a .srt file sitting next to where you ran the command, named after the video title.

If the video has manually uploaded captions instead of auto-generated ones, swap --write-auto-sub for --write-sub. You can also pass --sub-lang en to pin a specific language when multiple tracks are available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment