YouTube Summary Skill
You are tasked with fetching a YouTube video transcript and producing a structured summary.
Steps
- 1. Parse arguments: Read
$ARGUMENTS. Extract the YouTube URL and an optional language flag (--lang <language>). If no URL is provided, use the AskUserQuestion tool to ask the user for it. If no --lang flag is provided, default to English.
- 2. Fetch the transcript: Run the following command via Bash:
uv run --no-project --with youtube-transcript-api python -c "import sys,pathlib,runpy; h=pathlib.Path.home(); c=sorted(h.glob('.claude/plugins/cache/youtube-summary-skill/**/fetch_transcript.py')); s=c[-1] if c else h/'.claude/skills/youtube-summary-skill/fetch_transcript.py'; sys.argv=[str(s)]+sys.argv[1:]; runpy.run_path(str(s),run_name='__main__')" "$URL"
Replace
$URL with the actual YouTube URL.
- 3. Handle errors: If the JSON output contains an
"error" key, report the error to the user in a friendly way and stop.
- 4. Summarize: Using the transcript text, produce a structured summary in the chosen language with this format:
### Video Summary
Overview
A brief introductory paragraph summarizing the video's topic and main message.
Key Points
- Bullet points covering the main concepts discussed in the video
- Each point should be concise but informative
Notable Quotes
> Notable quotes or significant phrases from the video (if any stand out)
Translate section headings to match the chosen language (e.g., "Panoramica", "Punti chiave", "Citazioni notevoli" for Italian). If the transcript is in a different language than the chosen one, still produce the summary in the chosen language.
- 5. Offer to save: After presenting the summary, ask the user if they want to save it as a Markdown file. If yes, write it using the Write tool to a reasonable filename based on the video ID (e.g.,
youtube_summary_<video_id>.md).
Security & Permissions
What this skill does:
- - Runs a local Python script via
uv to fetch YouTube video transcripts using the youtube-transcript-api library - Uses YouTube's public transcript/caption data (no API key required)
- Optionally saves the generated summary as a local Markdown file
What this skill does NOT do:
- - Does not access your YouTube account or any authenticated data
- Does not upload, post, or modify any content on YouTube
- Does not send data to any third-party service
- Does not store or cache any credentials
- Cannot be invoked autonomously by agents (disable-model-invocation: true)
Bundled scripts: fetch_transcript.py (transcript fetcher)
Dependencies (managed by uv): INLINECODE9
Review the script before first use to verify behavior.
YouTube 摘要技能
你的任务是获取 YouTube 视频转录文本并生成结构化摘要。
步骤
- 1. 解析参数:读取 $ARGUMENTS。提取 YouTube URL 和可选的语种标志(--lang <语言>)。如果未提供 URL,则使用 AskUserQuestion 工具向用户询问。如果未提供 --lang 标志,则默认使用英语。
- 2. 获取转录文本:通过 Bash 运行以下命令:
bash
uv run --no-project --with youtube-transcript-api python -c import sys,pathlib,runpy; h=pathlib.Path.home(); c=sorted(h.glob(.claude/plugins/cache/youtube-summary-skill/
/fetch
transcript.py)); s=c[-1] if c else h/.claude/skills/youtube-summary-skill/fetchtranscript.py; sys.argv=[str(s)]+sys.argv[1:]; runpy.run
path(str(s),runname=
main) $URL
将 $URL 替换为实际的 YouTube URL。
- 3. 处理错误:如果 JSON 输出包含 error 键,请以友好的方式向用户报告错误并停止。
- 4. 生成摘要:使用转录文本,以所选语言生成结构化摘要,格式如下:
### 视频摘要
概述
简要介绍段落,总结视频的主题和主要信息。
要点
- 涵盖视频中讨论的主要概念的要点
- 每个要点应简洁但信息丰富
精彩引述
> 视频中值得注意的引述或重要短语(如果有突出内容)
将章节标题翻译成与所选语言匹配的格式(例如,意大利语为Panoramica、Punti chiave、Citazioni notevoli)。如果转录文本的语言与所选语言不同,仍以所选语言生成摘要。
- 5. 提供保存选项:呈现摘要后,询问用户是否要将其保存为 Markdown 文件。如果同意,使用 Write 工具将其写入基于视频 ID 的合理文件名(例如 youtubesummary.md)。
安全与权限
此技能的功能:
- - 通过 uv 运行本地 Python 脚本,使用 youtube-transcript-api 库获取 YouTube 视频转录文本
- 使用 YouTube 的公开转录/字幕数据(无需 API 密钥)
- 可选择将生成的摘要保存为本地 Markdown 文件
此技能不会执行的操作:
- - 不会访问你的 YouTube 账户或任何认证数据
- 不会在 YouTube 上上传、发布或修改任何内容
- 不会向任何第三方服务发送数据
- 不会存储或缓存任何凭据
- 不能被代理自主调用(disable-model-invocation: true)
捆绑脚本: fetch_transcript.py(转录文本获取器)
依赖项(由 uv 管理): youtube-transcript-api
首次使用前请审查脚本以验证其行为。