Loading...
Loading...
Download videos from YouTube, Bilibili, Twitter, and thousands of other sites using yt-dlp. Use when the user provides a video URL and wants to download it, extract audio (MP3), download subtitles, or select video quality. Triggers on phrases like "下载视频", "download video", "yt-dlp", "YouTube", "B站", "抖音", "提取音频", "extract audio".
npx skill4agent add unix2dos/skills yt-dlp-downloader# Check yt-dlp
which yt-dlp || echo "yt-dlp not installed. Install with: pip install yt-dlp"
# Check ffmpeg (required for audio extraction and format merging)
which ffmpeg || echo "ffmpeg not installed. Install with: brew install ffmpeg"pip install yt-dlp
brew install ffmpeg # macOSyt-dlp -P "~/Downloads/yt-dlp" "VIDEO_URL"yt-dlp -P "~/Downloads/yt-dlp" --cookies-from-browser chrome "YOUTUBE_URL"chromefirefoxsafariedgebraveoperayt-dlp -P "/path/to/save" -o "%(title)s.%(ext)s" "VIDEO_URL"yt-dlp -P "~/Downloads/yt-dlp" "VIDEO_URL"yt-dlp -P "~/Downloads/yt-dlp" -x --audio-format mp3 "VIDEO_URL"yt-dlp -P "~/Downloads/yt-dlp" --write-subs --sub-langs all "VIDEO_URL"yt-dlp -P "~/Downloads/yt-dlp" -f "bestvideo[height<=720]+bestaudio/best[height<=720]" "VIDEO_URL"yt-dlp -P "~/Downloads/yt-dlp" -f "bestvideo[height<=1080]+bestaudio/best[height<=1080]" "VIDEO_URL"yt-dlp -P "~/Downloads/yt-dlp" -f "bestvideo+bestaudio/best" "VIDEO_URL"yt-dlp -F "VIDEO_URL"yt-dlp -P "~/Downloads/yt-dlp" -f FORMAT_ID "VIDEO_URL"# Download entire playlist
yt-dlp -P "~/Downloads/yt-dlp" -o "%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "PLAYLIST_URL"
# Download specific range (e.g., items 1-5)
yt-dlp -P "~/Downloads/yt-dlp" -I 1:5 "PLAYLIST_URL"yt-dlp -P "~/Downloads/yt-dlp" --write-thumbnail "VIDEO_URL"--cookies-from-browser chromerequired_permissions: ["all", "network"]--cookies-from-browser-F# YouTube - use cookies to avoid 403 errors
yt-dlp -P "~/Downloads/yt-dlp" --cookies-from-browser chrome "https://www.youtube.com/watch?v=xxx"# Bilibili - extracting audio as MP3
yt-dlp -P "~/Downloads/yt-dlp" -x --audio-format mp3 "https://www.bilibili.com/video/xxx"# Twitter/X - direct download usually works
yt-dlp -P "~/Downloads/yt-dlp" "https://twitter.com/xxx/status/123"| Error | Cause | Solution |
|---|---|---|
| HTTP 403 Forbidden | YouTube blocks unauthenticated requests | Use |
| Video unavailable | Geo-restricted or private | Use cookies or VPN |
| Download interrupted | Network issues | Retry - yt-dlp auto-resumes |
| Format not available | Requested format doesn't exist | Use |
pip install yt-dlpbrew install ffmpeg # macOS# Recommended approach for YouTube
yt-dlp -P "~/Downloads/yt-dlp" --cookies-from-browser chrome "YOUTUBE_URL"chromefirefoxsafariedgebraveopera# Try with cookies from browser
yt-dlp --cookies-from-browser chrome "VIDEO_URL"
# Or use a specific format
yt-dlp -F "VIDEO_URL" # List formats first
yt-dlp -f FORMAT_ID "VIDEO_URL"# Update yt-dlp to latest version
pip install -U yt-dlp
# Force IPv4 (sometimes helps with connection issues)
yt-dlp -4 "VIDEO_URL"--cookies-from-browser chromepip install -U yt-dlp-F