# Youtube Summary

> Summarize YouTube videos into structured Markdown with youtube2md, including chaptered notes, timestamp links, and key takeaways. Use when the user provides one or more YouTube URLs and asks for summaries, study notes, language-specific summaries, transcript extraction, or machine-readable JSON output.

- Skill: `johnalbertini14-glitch/youtube-summary` (Agent Skill, multi-file: 18 files)
- Install (CLI): `npx skillmds@latest add johnalbertini14-glitch/youtube-summary`
- Raw SKILL.md: https://api.skillmd.com/api/skills/johnalbertini14-glitch/youtube-summary/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: johnalbertini14-glitch (https://skillmd.com/u/johnalbertini14-glitch)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/johnalbertini14-glitch/youtube-summary

---


# YouTube Summary (youtube2md)

Use the official `youtube2md` CLI behavior from the repository.

## Runtime + security prerequisites

- Require **Node.js 18+**.
- Require `npx` when using runtime npm execution mode (default).
- Require **python3** for transcript text preparation (`prepare.py`) in extract mode.
- Default runner is **hard-pinned** to `youtube2md@1.0.1` (not overridable by env flags).
- For stricter environments, disable runtime npm downloads with `YOUTUBE2MD_NO_RUNTIME_INSTALL=1` and provide a preinstalled `youtube2md` binary (or set `YOUTUBE2MD_BIN`).
- `OPENAI_API_KEY` enables full summarization mode; transcript/content may be sent to OpenAI through youtube2md’s workflow.
  - For sensitive content, omit `OPENAI_API_KEY` and use extract mode.
- In sensitive environments, audit the upstream `youtube2md` package and dependencies before enabling runtime downloads.

See `references/security.md` before first-time install/enable.

## Workflow

1. Validate input
   - Accept `youtube.com` and `youtu.be` URLs.
   - If URLs are missing, ask for one URL per line.

2. Choose mode
   - **Full mode**: generates Markdown.
     - Use when `OPENAI_API_KEY` is available and external API use is acceptable.
   - **Extract mode** (`--extract-only`): outputs transcript JSON and prepares transcript text (`.txt`).
     - Use when API key is unavailable or when transcript-only output is requested.
   - Prefer a **no-error path**: check key first and run extract directly when key is missing.

3. Run converter
   - Preferred runner script:
     - `scripts/run_youtube2md.sh <url> full [output_md_path] [language] [model]`
       - If `OPENAI_API_KEY` is missing, runner auto-falls back to extract mode by default.
     - `scripts/run_youtube2md.sh <url> extract [output_json_path]`
   - Optional machine-readable CLI output:
     - `YOUTUBE2MD_JSON=1 scripts/run_youtube2md.sh <url> full`
     - `YOUTUBE2MD_JSON=1 scripts/run_youtube2md.sh <url> extract`
   - Runtime controls:
     - Package target is fixed to `youtube2md@1.0.1`
     - Disable runtime npm download: `YOUTUBE2MD_NO_RUNTIME_INSTALL=1`
     - Use explicit local command/path: `YOUTUBE2MD_BIN=<cmd-or-path>`
   - Direct CLI equivalent:
     - Runtime install path: `npx --yes youtube2md@1.0.1 --url <url> [--out <path>] [--lang <language>] [--model <model>]`
     - Preinstalled binary path: `youtube2md --url <url> [--out <path>] [--lang <language>] [--model <model>]`
     - Add `--extract-only` for transcript-only mode.

4. Verify output
   - Full mode: Markdown file exists and is non-empty.
   - Extract mode: JSON file exists and is non-empty.
   - Extract mode: prepared TXT file exists and is non-empty.
   - If using `--json`, parse `ok: true/false` and handle error `code`.

5. Respond to the user
   - Follow `references/output-format.md` as the default response shape.
   - Follow `references/summarization-behavior.md` for source policy and chapter/takeaway density.
   - Do **not** include generated local file path(s) in normal user-facing replies.
   - Share file paths only when explicitly requested by the user (e.g., debugging/export workflows).
   - **Summary source policy:**
     - Full mode succeeded → use youtube2md Markdown output as the summary source.
     - Non-full mode (extract) → use prepared `.txt` transcript text as the summary source.
   - Keep user-facing flow smooth: if key is missing, use extract output and summarize from `.txt` without surfacing avoidable tool-error noise.

## Multi-video requests

- Process URLs sequentially.
- Return per-video summary results (omit local file paths unless requested).
- If any fail, report successful items first, then failures with fixes.

## Built-in behavior to trust

- Default output paths:
  - Full mode: `./summaries/<video_id>.md`
  - Extract mode: `./summaries/<video_id>.json`
  - Local runner post-process (extract): `./summaries/<video_id>.txt` via `prepare.py`

## Resources

- CLI runner: `scripts/run_youtube2md.sh`
- Transcript text prep: `prepare.py`
- Output guidance: `references/output-format.md`
- Behavior reference: `references/summarization-behavior.md`
- Security/install notes: `references/security.md`
- Troubleshooting and error codes: `references/troubleshooting.md`

