Video Download

calesthio/OpenMontage/.agents/skills/video-download

作者 calesthio9327439db69021ab4b0e2776729bf3b58fdb5a87無授權條款65K 個星標收錄於 2026年10月9日更新於 2026年10月9日儲存庫5 天前更新

Download video and audio from YouTube and 1000+ sites using yt-dlp. No API keys needed. Use when: (1) Downloading a video from YouTube or other sites, (2) Extracting audio from a video URL, (3) Downloading subtitles/captions from a video, (4) Getting video metadata without downloading.

僅含說明Design & Creative
AI 產生的概覽

使用 yt-dlp 指令從 YouTube 及其他網站下載影片、音訊、字幕與中繼資料。

功能
此技能提供可直接使用的 yt-dlp 命令列,用於從 YouTube 及眾多其他網站下載影片與音訊。內容涵蓋畫質與解析度預設、僅擷取音訊為 MP3、下載字幕與說明文字、在不下載的情況下取得中繼資料、列出可用格式,以及輸出目錄與檔名範本。它也列出前置需求、使用技巧與常見錯誤的疑難排解步驟。
適用情境
當你需要從網址取得影片或音訊檔案、從影片擷取音訊、下載字幕或說明文字,或在不下載的情況下查看影片中繼資料時使用。下載失敗而需要更新 yt-dlp 或安裝 ffmpeg 的指引時也適用。
執行需求
需要在本地安裝 yt-dlp 與 ffmpeg,並具備連線至目標網站的網路存取能力。不需要 API 金鑰。此技能不含指令碼,僅為說明文件與命令範例。

video-download

Download video and audio from URLs using yt-dlp directly. No wrapper scripts needed.

Prerequisites

  • yt-dlp: brew install yt-dlp or pip install yt-dlp
  • ffmpeg: brew install ffmpeg or apt install ffmpeg (required for merging video+audio streams)

Update yt-dlp periodically to keep up with site changes: yt-dlp -U or pip install -U yt-dlp.

Commands

Download best quality

bash
yt-dlp "URL" -o "%(title)s.%(ext)s" --merge-output-format mp4

Download specific resolution

bash
# 720pyt-dlp "URL" -f "bestvideo[height<=720]+bestaudio/best[height<=720]" --merge-output-format mp4
# 1080pyt-dlp "URL" -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" --merge-output-format mp4

Audio only

bash
yt-dlp "URL" -x --audio-format mp3 --audio-quality 0

Download subtitles

bash
# Download video with English subtitlesyt-dlp "URL" --write-subs --sub-langs en --merge-output-format mp4
# Download video with multiple subtitle languagesyt-dlp "URL" --write-subs --sub-langs "en,es,fr" --merge-output-format mp4
# Download only subtitles (no video)yt-dlp "URL" --write-subs --sub-langs en --skip-download

Get metadata (no download)

bash
yt-dlp "URL" --dump-json --no-download

List available formats

bash
yt-dlp "URL" -F

Specify output directory

bash
yt-dlp "URL" -o "./downloads/%(title)s.%(ext)s" --merge-output-format mp4

Quality Presets

QualityFormat flag
Best-f "bestvideo+bestaudio/best" (default)
1080p-f "bestvideo[height<=1080]+bestaudio/best[height<=1080]"
720p-f "bestvideo[height<=720]+bestaudio/best[height<=720]"
480p-f "bestvideo[height<=480]+bestaudio/best[height<=480]"
Worst-f "worstvideo+worstaudio/worst"

Output Template Variables

Common variables for -o templates:

VariableDescription
%(title)sVideo title
%(ext)sFile extension
%(id)sVideo ID
%(uploader)sChannel/uploader name
%(upload_date)sUpload date (YYYYMMDD)
%(duration)sDuration in seconds
%(resolution)sVideo resolution

Tips

  • Always use --merge-output-format mp4 to avoid ending up with .webm or .mkv files.
  • Use --no-download with --dump-json for metadata-only queries -- no files written to disk.
  • If a download fails with HTTP errors, update yt-dlp first (yt-dlp -U).
  • Use -f "bestvideo[height<=720]+bestaudio" to save bandwidth when full resolution is not needed.
  • yt-dlp automatically handles rate limiting and retries.
  • The --dump-json output includes title, duration, uploader, view_count, description, formats, subtitles, and much more.

Troubleshooting

  • "yt-dlp: command not found": Install it (pip install yt-dlp) and ensure your PATH includes pip's bin directory.
  • "ffmpeg: command not found": Install ffmpeg. Without it, downloads fail when video and audio are separate streams (common on YouTube for HD).
  • Downloads fail or return errors: Run yt-dlp -U to update. Sites change frequently and yt-dlp ships fixes regularly.

來源與署名

來源:calesthio/OpenMontage位於.agents/skills/video-download提交9327439

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架