{/* This page is auto-generated from the skill’s SKILL.md by website/scripts/generate-skill-docs.py. Edit the source SKILL.md, not this page. */}
Youtube Content
YouTube transcripts to summaries, threads, blogs.
技能元数据
| Source | Bundled (installed by default) |
| Path | skills/media/youtube-content |
| Platforms | linux, macos, windows |
参考:完整 SKILL.md
:::info The following is the complete skill definition that Hermes loads when this skill is triggered. This is what the agent sees as instructions when the skill is active. :::
YouTube Content Tool
适用场景
当用户分享 YouTube URL 或视频链接、要求总结视频、请求转录或希望提取和重新格式化 YouTube 视频内容时使用。将转录转为结构化内容(章节、摘要、推文、博客文章)。
从 YouTube 视频提取转录并将其转换为有用的格式。
设置
pip install youtube-transcript-apiHelper Script
SKILL_DIR is the directory containing this SKILL.md file. The script accepts any standard YouTube URL format, short links (youtu.be), shorts, embeds, live links, or a raw 11-character video ID.
# JSON output with metadata
python3 SKILL_DIR/scripts/fetch_transcript.py "https://youtube.com/watch?v=VIDEO_ID"
# Plain text (good for piping into further processing)
python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --text-only
# With timestamps
python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --timestamps
# Specific language with fallback chain
python3 SKILL_DIR/scripts/fetch_transcript.py "URL" --language tr,en输出格式
After fetching the transcript, format it based on what the user asks for:
- Chapters: Group by topic shifts, output timestamped chapter list
- Summary: Concise 5-10 sentence overview of the entire video
- Chapter summaries: Chapters with a short paragraph summary for each
- Thread: Twitter/X thread format — numbered posts, each under 280 chars
- Blog post: Full article with title, sections, and key takeaways
- Quotes: Notable quotes with timestamps
Example — Chapters Output
00:00 Introduction — host opens with the problem statement
03:45 Background — prior work and why existing solutions fall short
12:20 Core method — walkthrough of the proposed approach
24:10 Results — benchmark comparisons and key takeaways
31:55 Q&A — audience questions on scalability and next steps
工作流程
- Fetch the transcript using the helper script with
--text-only --timestamps. - Validate: confirm the output is non-empty and in the expected language. If empty, retry without
--languageto get any available transcript. If still empty, tell the user the video likely has transcripts disabled. - Chunk if needed: if the transcript exceeds ~50K characters, split into overlapping chunks (~40K with 2K overlap) and summarize each chunk before merging.
- Transform into the requested output format. If the user did not specify a format, default to a summary.
- Verify: re-read the transformed output to check for coherence, correct timestamps, and completeness before presenting.
Error Handling
- Transcript disabled: tell the user; suggest they check if subtitles are available on the video page.
- Private/unavailable video: relay the error and ask the user to verify the URL.
- No matching language: retry without
--languageto fetch any available transcript, then note the actual language to the user. - Dependency missing: run
pip install youtube-transcript-apiand retry.