Agent skill
youtube-transcribe-skill
Extract subtitles/transcripts from YouTube videos. Triggers: "youtube transcript", "extract subtitles", "video captions", "视频字幕", "字幕提取", "YouTube转文字", "提取字幕".
Install this agent skill to your Project
npx add-skill https://github.com/feiskyer/claude-code-settings/tree/main/plugins/youtube-transcribe-skill/skills/youtube-transcribe-skill
SKILL.md
YouTube Transcript Extraction
Extract subtitles/transcripts from a YouTube video URL and save them as a local file.
Input YouTube URL: $ARGUMENTS
Step 1: Verify URL
Confirm the input is a valid YouTube URL (supports youtube.com/watch?v=, youtu.be/, and youtube.com/shorts/ formats). If no URL is provided via arguments, check the conversation context for a YouTube link.
Step 2: CLI Quick Extraction (Priority Attempt)
Use command-line tools to quickly extract subtitles.
2.1 Check Tool Availability
Execute which yt-dlp.
- If
yt-dlpis found, proceed to 2.2. - If
yt-dlpis not found, skip to Step 3.
2.2 Get Video Title
yt-dlp --cookies-from-browser=chrome --get-title "[VIDEO_URL]"
- Tip: Always add
--cookies-from-browserto avoid sign-in restrictions. Default tochrome. - If it fails with a browser error (e.g., "Could not open Chrome"), ask the user to specify their available browser (e.g.,
firefox,safari,edge) and retry.
2.3 Download Subtitles
yt-dlp --cookies-from-browser=chrome --write-auto-sub --write-sub --sub-lang zh-Hans,zh-Hant,en --skip-download --output "<Video Title>.%(ext)s" "[VIDEO_URL]"
2.4 Convert to Plain Text
yt-dlp saves subtitles as .vtt or .srt files. Convert the downloaded file to plain Timestamp Text format:
- Read the downloaded subtitle file (
.vttor.srt). - Strip VTT/SRT headers, styling tags, and duplicate lines.
- Save as
<Video Title>.txtwith oneTimestamp Textentry per line.
2.5 Verify Results
- Exit code 0: Convert and save the subtitle file, then report completion.
- Exit code non-0:
- If error is related to browser/cookies, ask user for correct browser and retry.
- If other errors (e.g., video unavailable), proceed to Step 3.
Step 3: Browser Automation (Fallback)
When the CLI method fails or yt-dlp is missing, use Chrome DevTools MCP to extract subtitles via browser UI automation.
3.1 Check Tool Availability
Check if Chrome DevTools MCP tools are available (look for tools matching chrome__new_page or similar).
If Chrome DevTools MCP is not available and yt-dlp was not found in Step 2, stop and notify the user: "Unable to proceed. Please either install yt-dlp (for fast CLI extraction) or configure Chrome DevTools MCP (for browser automation)."
3.2 Open Video Page
Use Chrome DevTools MCP new_page to open the video URL.
3.3 Analyze Page State
Use Chrome DevTools MCP take_snapshot to read the page accessibility tree.
3.4 Expand Video Description
The "Show transcript" button is usually hidden within the collapsed description area.
- Search the snapshot for a button labeled "...more", "...更多", or "Show more" (in the description block below the video title).
- Use Chrome DevTools MCP
clickto click that button.
3.5 Open Transcript Panel
- Use Chrome DevTools MCP
take_snapshotto get the updated UI. - Search for a button labeled "Show transcript", "显示转录稿", or "内容转文字".
- Use Chrome DevTools MCP
clickto click that button. - If the button is not found, the video may not have a transcript available — notify the user and stop.
3.6 Extract Content via DOM
Directly reading the accessibility tree for long transcript lists is slow and token-heavy. Use Chrome DevTools MCP evaluate_script to run this JavaScript instead:
() => {
const segments = document.querySelectorAll("ytd-transcript-segment-renderer");
if (!segments.length) return "BUFFERING";
return Array.from(segments)
.map((seg) => {
const time = seg.querySelector(".segment-timestamp")?.innerText.trim();
const text = seg.querySelector(".segment-text")?.innerText.trim();
return `${time} ${text}`;
})
.join("\n");
};
If it returns "BUFFERING", wait a few seconds and retry (up to 3 attempts).
3.7 Save and Cleanup
- Save the extracted text as
<Video Title>.txt. - Use Chrome DevTools MCP
close_pageto release resources.
Output Requirements
- Save the subtitle file to the current working directory.
- Filename format:
<Video Title>.txt - File content format: Each line should be
Timestamp Subtitle Text. - Report upon completion: file path, subtitle language, and total number of lines.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
kiro-skill
Interactive feature development workflow from idea to implementation. Creates requirements (EARS format), design documents, and task lists. Triggers: "kiro", ".kiro/specs/", "feature spec", "需求文档", "设计文档", "实现计划".
github-review-pr
Review GitHub pull requests with detailed, multi-perspective code analysis using parallel subagents. Use this skill whenever the user wants to review a PR, asks for code review on a pull request, mentions "review PR", "check this PR", "look at pull request", or references a PR number or GitHub PR URL. Also trigger when the user wants feedback on code changes, wants to approve or request changes on a PR, or asks to review someone's contribution.
autonomous-skill
Execute long-running, multi-session tasks autonomously using Claude Code headless mode or in-session hook-based loops. Supports structured task decomposition (for complex projects) and lightweight Ralph-style iteration (for TDD, bug fixing, refactoring). Use this skill whenever the user says "autonomous", "long-running task", "multi-session", "run this in the background", "keep working on this", "batch process", "iterate until done", "ralph loop", or wants any task that requires sustained, unattended execution.
deep-research
深度调研的多Agent编排工作流:把一个调研目标拆成可并行子目标,用 Claude Code 非交互模式(`claude -p`)运行子进程;联网与采集优先使用已安装的 skills,其次使用 MCP 工具;用脚本聚合子结果并分章精修,最终交付"成品报告文件路径 + 关键结论/建议摘要"。用于:系统性网页/资料调研、竞品/行业分析、批量链接/数据集分片检索、长文写作与证据整合,或用户提及"深度调研/Deep Research/Wide Research/多 Agent 并行调研/多进程调研"等场景。
translate
Translate English or Japanese tech articles and texts into natural, fluent Chinese. Use this skill when the user wants to translate text to Chinese, asks for Chinese translation, mentions "translate to Chinese", "翻译", provides English/Japanese tech content for translation, or wants any text converted into Chinese. Also trigger when the user pastes text and asks to translate it, or references a file to translate into Chinese.
spec-kit-skill
GitHub Spec-Kit integration for constitution-based spec-driven development. 7-phase workflow. Triggers: "spec-kit", "speckit", "constitution", "specify", ".specify/", "规格驱动开发", "需求规格".
Didn't find tool you were looking for?