Export Subtitles for Reuse

Use this workflow when you need subtitles for editing, web playback, or a downstream caption pipeline.

Goal

Extract subtitles in the format best suited to where they will be consumed next.

  1. list_languages
  2. get_transcript

Why This Order

Subtitle export is one of the cases where format and language matter most. Choosing a caption track first prevents accidental fallback to the wrong language.

Walkthrough

1. Inspect available caption tracks

list_languages(url: "https://youtube.com/watch?v=VIDEO_ID")

Use this result to pick:

  • language code such as en or es
  • manual vs auto-generated captions

2. Export in the target format

For subtitle editors and media players that expect SRT:

get_transcript(
  url: "https://youtube.com/watch?v=VIDEO_ID",
  lang: "en",
  format: "srt"
)

For web use and browser-native caption workflows:

get_transcript(
  url: "https://youtube.com/watch?v=VIDEO_ID",
  lang: "en",
  format: "vtt"
)

For quick inspection without timestamps:

get_transcript(
  url: "https://youtube.com/watch?v=VIDEO_ID",
  lang: "en",
  format: "text"
)

Format Choice

  • srt: best for broad subtitle-tool compatibility
  • vtt: best for web and browser-oriented pipelines
  • text: best for rough copy extraction, not subtitle reuse

What To Expect

  • SRT uses comma-separated millisecond timestamps such as 00:00:01,800 --> 00:00:04,200
  • VTT starts with WEBVTT and uses dot-separated timestamps such as 00:00:01.800 --> 00:00:04.200

See Sample Outputs for exact examples.

Tips

  • If subtitles will be handed to another tool, prefer srt or vtt over markdown.
  • If the video has captions but transcript extraction returns an empty-result error, try a build with --features po-token.
  • If no captions exist at all, whisper can help generate text, but that path is not a substitute for official authored subtitle tracks.