Skip to content

Instantly share code, notes, and snippets.

@JosXa
Created July 19, 2026 23:45
Show Gist options
  • Select an option

  • Save JosXa/6bfdaaecc828baad171ae9dcceee9f96 to your computer and use it in GitHub Desktop.

Select an option

Save JosXa/6bfdaaecc828baad171ae9dcceee9f96 to your computer and use it in GitHub Desktop.
Agent skill for extracting and summarizing YouTube transcripts with yt-dlp
name youtube-transcript
description Load when user asks to fetch, extract, or summarize a YouTube video transcript. Contains yt-dlp workflow, subtitle parsing, and summarization patterns.

YouTube Transcript Extraction & Summarization

Reliable workflow for fetching and processing YouTube video transcripts using yt-dlp.

Prerequisites

  • Python 3 with pip
  • yt-dlp: Install with python -m pip install --user yt-dlp
  • Verify: python -m yt_dlp --version

Step 1: Download Subtitles

MUST use python -m yt_dlp (not bare yt-dlp) to guarantee the correct installation is invoked.

Auto-generated subtitles (most common)

python -m yt_dlp --skip-download --write-auto-subs --sub-langs "en.*" --sub-format vtt -o "%(id)s.%(ext)s" "VIDEO_URL"

Manual/uploaded subtitles (if available)

python -m yt_dlp --skip-download --write-subs --sub-langs "en" --sub-format vtt -o "%(id)s.%(ext)s" "VIDEO_URL"

List available subtitles first

python -m yt_dlp --list-subs "VIDEO_URL"

Key flags

Flag Purpose
--skip-download Do NOT download the video file
--write-auto-subs Fetch auto-generated captions
--write-subs Fetch manually uploaded captions
--sub-langs "en.*" English variants (en, en-US, en-GB, etc.)
--sub-format vtt WebVTT format (cleanest for parsing)
-o "%(id)s.%(ext)s" Output filename = video ID

Output

Produces a .vtt file, e.g., VIDEO_ID.en.vtt.

Step 2: Read and Summarize

  1. Read the full VTT file using the Read tool. VTT auto-subs contain repeated/overlapping lines (rolling windows) — this is normal, just read through it.
  2. Synthesize into a coherent summary.
  3. Structure the output with clear headings, bullet points, and blockquotes for key phrases.

Recommended summary structure

## Core Thesis
One-paragraph overview of the speaker's main argument.

## Key Concepts
Bulleted list of the main ideas with brief explanations.

## Supporting Arguments / Evidence
Deeper detail on how the speaker supports their claims.

## Key Quotes / Phrases
Notable exact phrases worth preserving.

## Takeaways
Actionable or memorable conclusions.

Tips & Gotchas

  • Auto-subs have no punctuation or speaker labels. Expect run-on text.
  • Prefer --sub-format vtt over srt — VTT is cleaner to parse and yt-dlp handles it more reliably.
  • Some videos have no English subs. Use --list-subs first if download fails, then try other languages.
  • Age-restricted or private videos may require cookies: --cookies-from-browser chrome or --cookies /path/to/cookies.txt.
  • Output directory: Use a temp directory, not the project root.
  • If yt-dlp is not installed, install it with python -m pip install --user yt-dlp. Do NOT use pip install directly (may target wrong Python).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment