Install
openclaw skills install @sunghyo/youtube-summarySummarize YouTube videos with youtube2md, including bare YouTube URLs with no instructions, chaptered notes, timestamp links, transcript extraction, and key takeaways.
openclaw skills install @sunghyo/youtube-summaryUse the official youtube2md CLI behavior from the package/repository (pinned youtube2md@1.2.0).
youtube2md on PATH.
npm i -g youtube2md@1.2.0youtube2md executable only.npx) is intentionally not supported by this skill runner.YOUTUBE2MD_BIN environment variable override is rejected by the runner.--provider auto, youtube2md tries:
@openai/codex-sdk peer (npm i -g @openai/codex-sdk) and a ChatGPT-authenticated Codex session. A logged-in codex CLI without the SDK is not enough. OPENAI_API_KEY is not passed to Codex.OPENAI_API_KEY is set.detectCodexChatGptLogin) rather than guessing, so its pre-check cannot disagree with the tool. When Codex is unavailable it logs the upstream reason, and in auto mode with OPENAI_API_KEY set it logs that the run will use the billed API path instead of the ChatGPT session.
npm i -g @openai/codex-sdk fails with EACCES on a root-owned node_modules/@openai, it needs sudo (the user must run it; the skill never escalates privileges).--model only when the fifth runner argument or YOUTUBE2MD_DEFAULT_MODEL is set; otherwise the upstream default (gpt-5.6-luna for both providers) and the per-provider CODEX_MODEL / OPENAI_MODEL env vars apply.--captions-only by default: audio is never sent to Whisper in simple/transcript mode. Set YOUTUBE2MD_CAPTIONS_ONLY=0 to allow Whisper STT for captionless videos (requires OPENAI_API_KEY).OPENAI_API_KEY is set. Set YOUTUBE2MD_CAPTIONS_ONLY=1 to forbid that in full mode too (captionless videos then fail instead).YOUTUBE_COOKIES_PATH or YOUTUBE_COOKIE_HEADER can be used when YouTube blocks anonymous caption/audio access.youtube2md@1.2.0 and dependencies before installation or future version bumps.See references/security.md before first-time install/enable.
Validate input
youtube.com and youtu.be URLs (watch, Shorts, Live, Embed, Music, and youtube-nocookie.com embed shapes are supported; timestamped &t= URLs are accepted but the whole video is processed).& when passing them to the shell.Pin the caption language
YOUTUBE2MD_CAPTION_LANG when the video's spoken language is known or inferable (user's request language, channel, title/description). Use en for an English video, ko for a Korean one, and so on.actualLanguage: "ar"), and the whole summary then comes out in Arabic.YOUTUBE2MD_CAPTION_LANG if a translated track was picked. YOUTUBE2MD_JSON=1 exposes actualLanguage for an exact check; otherwise glance at the transcript text.YOUTUBE2MD_CAPTION_LANG is unset. Treat that warning as a prompt to check the output language, not as noise.Choose mode
OPENAI_API_KEY) and external API use is acceptable, try full mode first.YOUTUBE2MD_DETAIL=concise|balanced|exhaustive (upstream default: balanced). Use exhaustive when the user asks for the densest possible notes, concise for a quick overview. --detail moves chapter-bullet density only; the ## Summary section stays short at every level.## Summary and detailed ## Chapters (youtube2md 1.2.0 design): the Summary is a few-sentence orientation that states the video's conclusion/verdict, and every supporting fact lives in the chapter bullets. A short Summary is not truncated output — never pad, expand, or rewrite it.--extract-only --extract-format timestamped-text --captions-only internally to produce a timestamped .txt transcript, then summarizes from that transcript.
YOUTUBE2MD_EXTRACT_FORMAT=json).Run converter
scripts/run_youtube2md.sh <url> full [output_md_path] [language] [model]
[model] and YOUTUBE2MD_DEFAULT_MODEL are optional; when omitted, upstream defaults apply.scripts/run_youtube2md.sh <url> extract [output_txt_path]
extract is the runner/CLI mode name; default artifact is timestamped text (.txt).simple when summarizing from the .txt.transcript when returning transcript-only output.YOUTUBE2MD_JSON=1 scripts/run_youtube2md.sh <url> fullYOUTUBE2MD_JSON=1 scripts/run_youtube2md.sh <url> extract--json or --stdout active, stdout carries a single data payload; runner status goes to stderr.YOUTUBE2MD_STDOUT=1 scripts/run_youtube2md.sh <url> extractYOUTUBE2MD_OUT_DIR=./output scripts/run_youtube2md.sh <url> extractYOUTUBE2MD_CAPTION_LANG=ko scripts/run_youtube2md.sh <url> extractYOUTUBE2MD_DETAIL=exhaustive scripts/run_youtube2md.sh <url> fullyoutube2md executable.npx) for this skill.youtube2md --url <url> [--out <path>] [--out-dir <dir>] [--lang <language>] [--model <model>] [--provider auto|codex|openai] [--detail concise|balanced|exhaustive]youtube2md --url <url> --extract-only --extract-format timestamped-text --captions-only [--out <path>]--caption-lang <code> to pin the caption language; omitting it lets YouTube's track order decide (see step 2).--captions-only in full mode to forbid the Whisper audio upload.--json for a versioned machine-readable result envelope (includes outputPath).--stdout to write output to stdout instead of a file.Verify output
--stdout is used..txt transcript exists and is non-empty when file output is used..txt or .json transcript output exists and is non-empty, unless --stdout is used.--json, parse the envelope: ok: true/false, outputPath, transcriptSource, actualLanguage, provider, fallbackUsed; handle error code per references/troubleshooting.md.Respond to the user
references/output-format.md for the response shape: full mode is a verbatim pass-through of the package Markdown; simple/transcript modes use the compact authored structure.references/summarization-behavior.md for source policy and chapter/takeaway density.(1/3), (2/3), (3/3) sends: on openclaw the first message tool call ends the turn, so the later parts never get sent. See references/output-format.md.youtube2md directly..txt transcript using the compact structure in references/output-format.md.Mode: fullMode: simpleMode: simple (fallback from full; no summarization provider available) when full was requested but the runner fell back and a summary was still produced.Mode: transcript when transcript-only output was requested..txt without surfacing avoidable tool-error noise../summaries/<video_id>.md./summaries/<video_id>.txt (timestamped text) or ./summaries/<video_id>.json (YOUTUBE2MD_EXTRACT_FORMAT=json)gpt-5.6-luna for both providers; CODEX_MODEL / OPENAI_MODEL override per provider; the fifth runner argument or YOUTUBE2MD_DEFAULT_MODEL overrides everything via --model.--detail, full mode): chapter-bullet density scales with video length and content density at every level; the flag only shifts where the target sits (concise ≈ one bullet per ~750 transcript tokens, balanced ≈ ~450 (default), exhaustive ≈ ~300, densest notes). Responses that land far below the requested target (under 70%) are re-requested once automatically.## Summary is an orientation, not a recap: its sentence budget scales with duration but is hard-capped at 8 sentences (~3 for a 1-hour video) with a matching word ceiling, and it must state the video's actual conclusion/verdict — answering the title outright when the title poses a question. --detail does not lengthen it.## Chapters carries the detail. Bullets are budgeted as one approximate total per request and spent unevenly, so a dense section gets several times more bullets than a transitional one.CHUNK_CHAPTER_CAP = 9 chapters per full-size chunk) rather than --detail; --detail shifts chapter density only for short or sparse sections.<= 20000 transcript tokens (and whenever the split yields one chunk, up to ~25000); chunk target is 20000 tokens with boundaries snapped to native chapter starts or speech pauses, summarized up to 4 chunks in parallel.--caption-lang prefers an exact match, then the same base language, then another track.youtube-transcript fallback.whisper-1, audio under 24 MB) when OPENAI_API_KEY is available; skipped under --captions-only (the runner's extract-mode default) or when no API key is set.[M:SS] / [MM:SS] (and [H:MM:SS] past one hour); chapter display times and ?t= links always agree.summaries/*.md, summaries/*.txt, summaries/*.json) inside the skill folder.SKILL.md, scripts/, references/) in release artifacts.scripts/run_youtube2md.shreferences/output-format.mdreferences/summarization-behavior.mdreferences/security.mdreferences/troubleshooting.md