AGENT SKILL

youtube-transcript

Use whenever the user needs the transcript of a YouTube video — fetching, extracting, downloading, or pulling captions/subtitles/transcript text from a YouTube URL via yt-dlp.

License 许可
MIT
最近更新
2026-11-15
Stars
★ 1
Forks
0

01 前言 Front Matter

name
youtube-transcript
description
Use whenever the user needs the transcript of a YouTube video — fetching, extracting, downloading, or pulling captions/subtitles/transcript text from a YouTube URL via yt-dlp.
disable-model-invocation
true

02 资源文件 2

03 SKILL.md 正文

<!-- Adapted from davidondrej/skills (MIT) — LICENSE + UPSTREAM.md in this directory carry full attribution. ALL DeepAPI content stripped (paid third-party path we don't subscribe to); this is the yt-dlp fallback standing alone. disable-model-invocation SET (upstream had it model-invocable): content is thin without the vendor path, and grep found zero existing transcript-fetching workflow in this harness to justify an always-on trigger — invoke explicitly with /youtube-transcript instead. Revisit if usage shows this recurring. -->

YouTube Transcript (yt-dlp)

Fetch a YouTube video's transcript and save a clean raw .txt file via yt-dlp captions — no third-party API, everything below runs locally.

Save location

  • If the user is in a real project/working dir → save there.
  • Otherwise (no dir given, or cwd makes no sense) → save to ~/Downloads.
  • Always name the file Channel_Title with spaces replaced by _ (e.g. David_Ondrej_title_of_video.txt). If metadata is unavailable, fall back to the video ID.

Fetch captions

OUT="$(pwd)"            # see Save location above
META=$(yt-dlp --print "%(channel)s|%(title)s" --skip-download "URL")
NAME=$(echo "$META" | tr '| ' '__' | tr -cd '[:alnum:]_.-')   # "Channel_Title", spaces -> _, strip unsafe chars
yt-dlp --skip-download --write-subs --write-auto-subs \
  --sub-langs "en.*" --sub-format json3 \
  -o "$OUT/$NAME.%(ext)s" "URL"
  • Fall back channel → uploader → uploader_id if channel is null.
  • --skip-download = captions only. --write-subs + --write-auto-subs = manual first, auto as fallback.
  • Always use json3, never VTT/SRT — auto VTT repeats every line twice (rolling captions).

Flatten json3 → raw text

python3 - "$OUT" "$NAME" <<'PY'
import json, html, re, sys, pathlib
out_dir, name = pathlib.Path(sys.argv[1]), sys.argv[2]
# Only this video's files ("<NAME>.<lang>.json3"); other videos' captions in the folder are ignored.
f = sorted(p for p in out_dir.glob("*.json3") if p.name.rsplit(".", 2)[0] == name)
if not f: sys.exit("no json3 caption file for this video")
if len(f) > 1:
    # Auto captions arrive as both "en" and "en-orig" (same text); a manual "en" track takes the "en" name.
    f = [p for p in f if p.name == name + ".en.json3"]
    if not f: sys.exit("several caption languages and no plain 'en'; rerun yt-dlp with one --sub-langs value")
data = json.load(open(f[0], encoding="utf-8"))
parts = ["".join(s.get("utf8","") for s in e.get("segs") or []) for e in data.get("events", [])]
txt = re.sub(r"\s+", " ", html.unescape(" ".join(p.strip() for p in parts if p.strip()))).strip()
out = out_dir / (name + ".txt")
out.write_text(txt, encoding="utf-8"); print(out)
PY

Failure handling

  • Non-English / unknown language: run yt-dlp --list-subs "URL" first, then set --sub-langs.
  • Newer yt-dlp may need deno on PATH for YouTube extraction.
  • On first failure: run yt-dlp -U once, retry once, then stop.
  • 429 / "Sign in to confirm you're not a bot" = IP flagged. STOP — do NOT retry in a loop (makes it worse).
  • Never fall back to downloading audio for Whisper unless the user explicitly asks.

Output

Report the saved path; print the text if under ~500 words, otherwise just report the saved path.

04 同仓库更多 Skills

StartupBros-com
StartupBros-com/hov-stack

review-adversarial-first

Operator-invoked adversarial review: 3 refute-by-default lenses plus a deterministic judge against a PR, branch, or path, then a decision on whether /ce-code-review's topic fan-out runs. Off the default merge path since the 2026-10-17 merge-and-end ruling; run only when asked for by name.

★ 1
StartupBros-com
StartupBros-com/hov-stack

memory-mine

Run one deterministic, budgeted directed-capture batch for an explicit Claude Code project store. Use manual workspace mode only when cross-agent cass sessions are intentionally in scope.

★ 1
StartupBros-com
StartupBros-com/hov-stack

papers

Search preprints from arXiv, bioRxiv, and medRxiv without API keys. Supports search, lookup, extraction, citations, enrichment, and paper downloads that bundle PDFs plus linked GitHub code.

★ 1
StartupBros-com
StartupBros-com/hov-stack

papers

Search preprints from arXiv, bioRxiv, and medRxiv without API keys. Supports search, lookup, extraction, citations, enrichment, and paper downloads that bundle PDFs plus linked GitHub code.

★ 1
StartupBros-com
StartupBros-com/hov-stack

wsl-cdp

Drive the user's real, logged-in Windows browser (Chrome, Edge, or Brave) from a Claude Code session running inside WSL2, over the Chrome DevTools Protocol - read authenticated dashboards and consoles, take real screenshots, open and read pages with the user's sessions. Use when a task needs the user's existing web logins and the session runs in WSL2, where the Claude in Chrome extension cannot work. Not for native-Windows or macOS Claude Code (use the official Claude in Chrome extension), not for anonymous scraping or CI (use headless Playwright inside WSL), not for getting past login walls (those are handed to the human).

★ 1
StartupBros-com
StartupBros-com/hov-stack

token-eater

[BETA] Spend a subscription's idle, about-to-expire credits on safe, machine-verified cleanup. You pick the service (Grok / Codex / Claude) and a token-heavy maintenance skill (de-monolithize, de-slop, simplify, dead-code); that service runs the whole skill -> gate -> self-review -> draft-PR loop on its own credits, in an isolated worktree. token-eater verifies the gate and never merges. Manual invocation only during beta.

★ 1