| 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. |
Reliable workflow for fetching and processing YouTube video transcripts using yt-dlp.
- Python 3 with pip
- yt-dlp: Install with
python -m pip install --user yt-dlp - Verify:
python -m yt_dlp --version
MUST use python -m yt_dlp (not bare yt-dlp) to guarantee the correct installation is invoked.
python -m yt_dlp --skip-download --write-auto-subs --sub-langs "en.*" --sub-format vtt -o "%(id)s.%(ext)s" "VIDEO_URL"python -m yt_dlp --skip-download --write-subs --sub-langs "en" --sub-format vtt -o "%(id)s.%(ext)s" "VIDEO_URL"python -m yt_dlp --list-subs "VIDEO_URL"| 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 |
Produces a .vtt file, e.g., VIDEO_ID.en.vtt.
- 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.
- Synthesize into a coherent summary.
- Structure the output with clear headings, bullet points, and blockquotes for key phrases.
## 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.- Auto-subs have no punctuation or speaker labels. Expect run-on text.
- Prefer
--sub-format vttoversrt— VTT is cleaner to parse and yt-dlp handles it more reliably. - Some videos have no English subs. Use
--list-subsfirst if download fails, then try other languages. - Age-restricted or private videos may require cookies:
--cookies-from-browser chromeor--cookies /path/to/cookies.txt. - Output directory: Use a temp directory, not the project root.
- If
yt-dlpis not installed, install it withpython -m pip install --user yt-dlp. Do NOT usepip installdirectly (may target wrong Python).