Tooluck logoTooluck
SKILL.md

youtube-transcribe-skill

Agent skill fromfeiskyer/claude-code-settings

Extract subtitles/transcripts from YouTube videos. Triggers: "youtube transcript", "extract subtitles", "video captions", "视频字幕", "字幕提取", "YouTube转文字", "提取字幕".

How to install youtube-transcribe-skill

install youtube-transcribe-skill
# install the claude-code-settings pack with the skills CLI
npx skills add feiskyer/claude-code-settings

# or add only this skill to Claude Code: copy the folder

skills/youtube-transcribe-skill/

# into

~/.claude/skills/youtube-transcribe-skill/ (all projects)

.claude/skills/youtube-transcribe-skill/ (one project)

skills/youtube-transcribe-skill/SKILL.md

MITFull file
1# YouTube Transcript Extraction
2
3Extract subtitles/transcripts from a YouTube video URL and save them as a local file.
4
5Input YouTube URL: $ARGUMENTS
6
7## Step 1: Verify URL
8
9Confirm 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.
10
11## Step 2: CLI Quick Extraction (Priority Attempt)
12
13Use command-line tools to quickly extract subtitles.
14
15### 2.1 Check Tool Availability
16
17Execute `which yt-dlp`.
18
19- If `yt-dlp` is **found**, proceed to 2.2.
20- If `yt-dlp` is **not found**, skip to **Step 3**.
21
22### 2.2 Get Video Title
23
24```bash
25yt-dlp --cookies-from-browser=chrome --get-title "[VIDEO_URL]"
26```
27
28- **Tip**: Always add `--cookies-from-browser` to avoid sign-in restrictions. Default to `chrome`.
29- 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.
30
31### 2.3 Download Subtitles
32
33```bash
34yt-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]"
35```
36
37### 2.4 Convert to Plain Text
38
39`yt-dlp` saves subtitles as `.vtt` or `.srt` files. Convert the downloaded file to plain `Timestamp Text` format:
40
411. Read the downloaded subtitle file (`.vtt` or `.srt`).
422. Strip VTT/SRT headers, styling tags, and duplicate lines.
43…

Excerpt shown under the repository's MIT license.

More skills in claude-code-settings

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates