video-download
Original:🇺🇸 English
Translated
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.
6installs
Sourceheygen-com/skills
Added on
NPX Install
npx skill4agent add heygen-com/skills video-downloadTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →video-download
Download video and audio from URLs using yt-dlp directly. No wrapper scripts needed.
Prerequisites
- yt-dlp: or
brew install yt-dlppip install yt-dlp - ffmpeg: or
brew install ffmpeg(required for merging video+audio streams)apt install ffmpeg
Update yt-dlp periodically to keep up with site changes: or .
yt-dlp -Upip install -U yt-dlpCommands
Download best quality
bash
yt-dlp "URL" -o "%(title)s.%(ext)s" --merge-output-format mp4Download specific resolution
bash
# 720p
yt-dlp "URL" -f "bestvideo[height<=720]+bestaudio/best[height<=720]" --merge-output-format mp4
# 1080p
yt-dlp "URL" -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" --merge-output-format mp4Audio only
bash
yt-dlp "URL" -x --audio-format mp3 --audio-quality 0Download subtitles
bash
# Download video with English subtitles
yt-dlp "URL" --write-subs --sub-langs en --merge-output-format mp4
# Download video with multiple subtitle languages
yt-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-downloadGet metadata (no download)
bash
yt-dlp "URL" --dump-json --no-downloadList available formats
bash
yt-dlp "URL" -FSpecify output directory
bash
yt-dlp "URL" -o "./downloads/%(title)s.%(ext)s" --merge-output-format mp4Quality Presets
| Quality | Format flag |
|---|---|
| Best | |
| 1080p | |
| 720p | |
| 480p | |
| Worst | |
Output Template Variables
Common variables for templates:
-o| Variable | Description |
|---|---|
| Video title |
| File extension |
| Video ID |
| Channel/uploader name |
| Upload date (YYYYMMDD) |
| Duration in seconds |
| Video resolution |
Tips
- Always use to avoid ending up with
--merge-output-format mp4or.webmfiles..mkv - Use with
--no-downloadfor metadata-only queries -- no files written to disk.--dump-json - If a download fails with HTTP errors, update yt-dlp first ().
yt-dlp -U - Use to save bandwidth when full resolution is not needed.
-f "bestvideo[height<=720]+bestaudio" - yt-dlp automatically handles rate limiting and retries.
- The output includes
--dump-json,title,duration,uploader,view_count,description,formats, and much more.subtitles
Troubleshooting
- "yt-dlp: command not found": Install it () and ensure your PATH includes pip's bin directory.
pip install yt-dlp - "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 to update. Sites change frequently and yt-dlp ships fixes regularly.
yt-dlp -U