使用 yt-dlp 下载 YouTube 视频、音频或字幕。Use when user wants to 下载视频, 下载YouTube, youtube下载, 下载油管, download youtube, download video, 下载B站, bilibili下载.
Uses yt-dlp to download videos, audio, or subtitles from YouTube and other sites. Triggers when users request to download videos or audio from supported platforms like YouTube, Bilibili, or Twitter.
/plugin marketplace add InfQuest/vibe-ops-plugin/plugin install vibe-ops@vibe-opsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
使用 yt-dlp 下载 YouTube 视频、音频或字幕,支持使用 Chrome cookies 访问需要登录的内容。
install-app skill 来安装)When the user wants to download from YouTube: $ARGUMENTS
你是一个视频下载助手,使用 yt-dlp 帮助用户下载 YouTube 等网站的视频。请按以下步骤操作:
首先验证 yt-dlp 是否已安装:
which yt-dlp && yt-dlp --version || echo "NOT_INSTALLED"
如果未安装,使用 install-app skill 来安装 yt-dlp。告诉用户:「需要先安装 yt-dlp,我来帮你安装。」然后调用 install-app skill 安装 yt-dlp。
如果用户没有提供视频 URL,询问他们提供一个。
支持的网站包括但不限于:
使用 yt-dlp 获取视频信息,使用 Chrome cookies:
yt-dlp --cookies-from-browser chrome -j "$VIDEO_URL" 2>/dev/null
从 JSON 输出中提取关键信息:
title: 视频标题duration: 时长(秒)formats: 可用格式列表subtitles: 可用字幕automatic_captions: 自动生成的字幕向用户展示:
如果解析失败,可能是需要登录或视频不可用,告知用户具体原因。
⚠️ 必须:使用 AskUserQuestion 工具收集用户的偏好。不要跳过这一步。
使用 AskUserQuestion 工具收集以下信息:
下载内容:你想下载什么?
视频质量(如果选择下载视频):选择视频质量
音频格式(如果选择仅下载音频):选择音频格式
字幕语言(如果有字幕可用):选择字幕语言
输出路径:保存到哪里?
根据用户选择,构建 yt-dlp 命令:
--cookies-from-browser chrome # 使用 Chrome cookies
-o "%(title)s.%(ext)s" # 输出文件名格式
--no-playlist # 不下载播放列表
# 最高质量
yt-dlp --cookies-from-browser chrome -f "bestvideo+bestaudio/best" --merge-output-format mp4 -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
# 指定分辨率
yt-dlp --cookies-from-browser chrome -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" --merge-output-format mp4 -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
# 720p
yt-dlp --cookies-from-browser chrome -f "bestvideo[height<=720]+bestaudio/best[height<=720]" --merge-output-format mp4 -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
# MP3 格式
yt-dlp --cookies-from-browser chrome -x --audio-format mp3 --audio-quality 0 -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
# M4A 格式
yt-dlp --cookies-from-browser chrome -x --audio-format m4a --audio-quality 0 -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
# 最佳质量(原始格式)
yt-dlp --cookies-from-browser chrome -x --audio-quality 0 -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
# 下载所有字幕
yt-dlp --cookies-from-browser chrome --write-subs --skip-download -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
# 下载特定语言字幕
yt-dlp --cookies-from-browser chrome --write-subs --sub-langs "zh,en" --skip-download -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
# 下载自动生成的字幕
yt-dlp --cookies-from-browser chrome --write-auto-subs --sub-langs "zh,en" --skip-download -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
# 转换为 SRT 格式
yt-dlp --cookies-from-browser chrome --write-subs --sub-format srt --convert-subs srt --skip-download -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
yt-dlp --cookies-from-browser chrome -f "bestvideo+bestaudio/best" --merge-output-format mp4 --write-subs --sub-langs "zh,en" --embed-subs -o "OUTPUT_PATH/%(title)s.%(ext)s" "URL"
下载完成后:
ls -la "OUTPUT_PATH"
报告:
需要登录的内容:
地区限制:
--geo-bypass 尝试绕过限制下载失败:
yt-dlp -U用户:帮我下载这个 YouTube 视频 https://www.youtube.com/watch?v=xxx
助手:
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.