video-downloader
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVideo Downloader - Download Videos with yt-dlp
视频下载工具 - 使用yt-dlp下载视频
Download videos, audio, or subtitles from YouTube, Bilibili, Twitter, and 1000+ other sites using yt-dlp.
使用yt-dlp从YouTube、Bilibili、Twitter及其他1000+平台下载视频、音频或字幕。
When to Use
适用场景
- User asks to download a video
- User asks to download or extract audio
- User asks to download subtitles
- User provides a video URL (YouTube, Bilibili, Twitter, etc.)
- User wants to specify video quality (720p, 1080p, etc.)
- 用户要求下载视频
- 用户要求下载或提取音频
- 用户要求下载字幕
- 用户提供视频URL(YouTube、Bilibili、Twitter等)
- 用户想要指定视频画质(720p、1080p等)
Prerequisites - Auto Install
前置条件 - 自动安装
IMPORTANT: Before any download, check and install dependencies automatically.
重要提示: 在进行任何下载操作前,请自动检查并安装依赖项。
Step 0: Check and Install Dependencies
步骤0:检查并安装依赖项
bash
undefinedbash
undefinedCheck if yt-dlp is installed, install if missing
Check if yt-dlp is installed, install if missing
if ! command -v yt-dlp &>/dev/null; then
echo "Installing yt-dlp..."
brew install yt-dlp
fi
if ! command -v yt-dlp &>/dev/null; then
echo "Installing yt-dlp..."
brew install yt-dlp
fi
Check if ffmpeg is installed, install if missing
Check if ffmpeg is installed, install if missing
if ! command -v ffmpeg &>/dev/null; then
echo "Installing ffmpeg..."
brew install ffmpeg
fi
if ! command -v ffmpeg &>/dev/null; then
echo "Installing ffmpeg..."
brew install ffmpeg
fi
Verify installation
Verify installation
yt-dlp --version && echo "yt-dlp: ready"
ffmpeg -version 2>&1 | head -1 && echo "ffmpeg: ready"
Run this check **every time** before downloading. Install automatically without asking user.yt-dlp --version && echo "yt-dlp: ready"
ffmpeg -version 2>&1 | head -1 && echo "ffmpeg: ready"
每次下载前都要运行此检查,无需询问用户,自动完成安装。Instructions for Agent
Agent操作指南
Step 1: Ensure Dependencies Installed
步骤1:确保依赖项已安装
Run the prerequisite check above. If yt-dlp or ffmpeg is missing, install via .
brew install yt-dlp ffmpeg运行上述前置条件检查。如果缺少yt-dlp或ffmpeg,通过进行安装。
brew install yt-dlp ffmpegStep 2: Parse User Intent
步骤2:解析用户意图
Identify what the user wants:
| User Intent | Keywords |
|---|---|
| Video (default) | "download", "video" |
| Audio only | "audio", "mp3", "music", "extract audio" |
| Video + Subtitles | "with subtitles", "embed subtitles" |
| Subtitles only | "only subtitles", "subtitles only", "just subtitles" |
| Specific quality | "720p", "1080p", "4k", "best", "worst" |
识别用户需求:
| 用户意图 | 关键词 |
|---|---|
| 视频下载(默认) | "download"、"video" |
| 仅音频 | "audio"、"mp3"、"music"、"extract audio" |
| 视频+字幕 | "with subtitles"、"embed subtitles" |
| 仅字幕 | "only subtitles"、"subtitles only"、"just subtitles" |
| 指定画质 | "720p"、"1080p"、"4k"、"best"、"worst" |
Step 3: Build Command
步骤3:构建命令
Base command structure:
bash
yt-dlp [OPTIONS] "URL"Common options by intent:
- Basic video download (best quality):
bash
yt-dlp -o "%(title)s.%(ext)s" "URL"- Audio only (MP3):
bash
yt-dlp -x --audio-format mp3 -o "%(title)s.%(ext)s" "URL"- Specific quality (e.g., 720p):
bash
yt-dlp -f "bestvideo[height<=720]+bestaudio/best[height<=720]" -o "%(title)s.%(ext)s" "URL"- Video with embedded subtitles:
bash
yt-dlp --write-subs --sub-lang en,zh-Hans,zh-Hant --embed-subs -o "%(title)s.%(ext)s" "URL"- Subtitles only (no video):
bash
yt-dlp --write-subs --write-auto-subs --sub-lang en,zh-Hans,zh-Hant --skip-download -o "%(title)s" "URL"基础命令结构:
bash
yt-dlp [OPTIONS] "URL"按意图分类的常用选项:
- 基础视频下载(最佳画质):
bash
yt-dlp -o "%(title)s.%(ext)s" "URL"- 仅音频(MP3格式):
bash
yt-dlp -x --audio-format mp3 -o "%(title)s.%(ext)s" "URL"- 指定画质(例如720p):
bash
yt-dlp -f "bestvideo[height<=720]+bestaudio/best[height<=720]" -o "%(title)s.%(ext)s" "URL"- 带内嵌字幕的视频:
bash
yt-dlp --write-subs --sub-lang en,zh-Hans,zh-Hant --embed-subs -o "%(title)s.%(ext)s" "URL"- 仅字幕(无视频):
bash
yt-dlp --write-subs --write-auto-subs --sub-lang en,zh-Hans,zh-Hant --skip-download -o "%(title)s" "URL"Step 4: Execute and Report
步骤4:执行并反馈
Run the command and report:
- File name and location
- File size (if available)
- Any warnings or errors
运行命令后反馈以下信息:
- 文件名及存储位置
- 文件大小(若可获取)
- 任何警告或错误信息
Command Reference
命令参考
| Task | Command |
|---|---|
| Best quality video | |
| Audio (MP3) | |
| Audio (M4A) | |
| 720p video | |
| 1080p video | |
| 4K video | |
| With subtitles | |
| Subtitles only | |
| List formats | |
| Playlist | |
| 任务 | 命令 |
|---|---|
| 最佳画质视频 | |
| 音频(MP3格式) | |
| 音频(M4A格式) | |
| 720p视频 | |
| 1080p视频 | |
| 4K视频 | |
| 带字幕的视频 | |
| 仅字幕 | |
| 列出可用格式 | |
| 播放列表下载 | |
Response Guidelines
回复准则
- Always confirm what will be downloaded before starting
- Show download progress or final result
- Report the output file name and location
- If download fails, explain the error and suggest solutions
- 开始下载前务必确认将要下载的内容
- 展示下载进度或最终结果
- 告知输出文件名及存储位置
- 若下载失败,说明错误原因并给出解决方案
Error Handling
错误处理
| Error | Solution |
|---|---|
| Auto-install: |
| Auto-install: |
| Check if URL is correct or video is region-locked |
| Cannot download private videos without authentication |
| Use |
| Try |
| Install Homebrew first: |
| 错误 | 解决方案 |
|---|---|
| 自动安装: |
| 自动安装: |
| 检查URL是否正确或视频是否受区域限制 |
| 无认证情况下无法下载私有视频 |
| 使用 |
| 尝试添加 |
| 先安装Homebrew: |