Download subtitles/transcripts from video platforms. Triggers: "download subtitle", "extract subtitle", "video subtitle", "transcript", "字幕下载", "提取字幕", "视频字幕".
/plugin marketplace add wuyuxiangX/yux-claude-hub/plugin install yux-video-to-blog@yux-claude-hubThis skill is limited to using the following tools:
Extract subtitles/transcripts from video URLs and save them as local text files.
Supported platforms: YouTube, Bilibili, Twitter/X, Vimeo, TikTok, and all other platforms supported by yt-dlp.
Input Video URL: $ARGUMENTS
Check yt-dlp installation:
which yt-dlp
yt-dlp is found, proceed to Step 2.yt-dlp is NOT found, notify user:
"yt-dlp is not installed. Please install it first: brew install yt-dlp or pip install yt-dlp"
Then STOP execution.Get video title:
yt-dlp --get-title "[VIDEO_URL]"
If this fails with authentication error, try with cookies:
yt-dlp --cookies-from-browser chrome --get-title "[VIDEO_URL]"
If browser cookie extraction fails, ask user to specify their browser (firefox, safari, edge) and retry.
Store the video title for file naming (sanitize special characters).
Attempt subtitle download with language priority (Chinese first, then English):
yt-dlp --write-auto-sub --write-sub --sub-lang zh-Hans,zh-Hant,zh,en --skip-download --sub-format vtt --output "<Video Title>.%(ext)s" "[VIDEO_URL]"
yt-dlp --cookies-from-browser chrome --write-auto-sub --write-sub --sub-lang zh-Hans,zh-Hant,zh,en --skip-download --sub-format vtt --output "<Video Title>.%(ext)s" "[VIDEO_URL]"
Handle platform-specific cases:
--cookies-from-browser for member-only videos--write-auto-sub for auto-generated subtitlesVerify download:
.vtt or .srt file was createdRead the downloaded subtitle file (.vtt or .srt)
Extract and clean content:
Format output:
[Timestamp] Text contentDetect source language:
.zh-Hans.vtt, .zh-Hant.vtt, .zh.vtt → zh.en.vtt, .en-US.vtt, .en-GB.vtt → en.ja.vtt → ja.ko.vtt → ko\u4e00-\u9fff)zhenStore the detected language code: video_language (e.g., zh, en)
Save the transcript to: <Video Title>.txt
Report completion with language info:
[zh/en/ja/ko]File saved: <Video Title>.txt
Language code: zh
Language: Chinese (auto-generated)
Lines: 245
Size: 12.5 KB
The language code (zh, en, etc.) will be used by the yux-video-summary skill for multi-language output generation.