YouTube Downloader
Your understanding is correct: after installing yt-dlp with pip, you can usually use it directly in the terminal.
1. Minimal Installation Steps
python -m pip install -U yt-dlp
Verify installation:
yt-dlp --version
If you get yt-dlp: command not found, you can run it via module mode first:
python -m yt_dlp --version
2. Direct Download (Out of the Box)
yt-dlp https://www.youtube.com/watch?v=jIviHI7fqyc
Note: This command directly downloads the video; it does not list formats. Use -F to list formats.
3. Common Commands (Concise Version)
Command example (based on your -F result: 299 = 1080p60 video, 140 = m4a audio):
yt-dlp -f "299+140" --merge-output-format mp4 -o "%(title)s.%(ext)s" "https://www.youtube.com/watch?v=jIviHI7fqyc"
Local verification command (process validation only, no actual download):
yt-dlp -f "299+140" --merge-output-format mp4 -o "%(title)s.%(ext)s" "https://www.youtube.com/watch?v=jIviHI7fqyc" --simulate --skip-download
List available formats:
yt-dlp -F https://www.youtube.com/watch?v=jIviHI7fqyc
Download best MP4 video+audio and merge into MP4:
yt-dlp -f "bv[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" --merge-output-format mp4 https://www.youtube.com/watch?v=jIviHI7fqyc
Extract audio and convert to MP3:
yt-dlp -x --audio-format mp3 https://www.youtube.com/watch?v=jIviHI7fqyc
Keep only the title as filename (without ID):
yt-dlp -o "%(title)s.%(ext)s" https://www.youtube.com/watch?v=jIviHI7fqyc
Download a playlist (must use a playlist URL):
yt-dlp "https://www.youtube.com/playlist?list=..."
4. Increase Download Speed (Optional)
Use the external downloader aria2c:
yt-dlp --downloader aria2c --downloader "dash,m3u8:native" https://www.youtube.com/watch?v=jIviHI7fqyc
5. When ffmpeg Is Needed
- Basic downloads: in many cases downloads can work directly, and ffmpeg is not always a hard dependency.
- Audio/video merging (such as
--merge-output-format) and post-processing (such as-x --audio-format mp3): require ffmpeg/ffprobe.
6. References
- yt-dlp official repository: https://github.com/yt-dlp/yt-dlp
- PyPI (installation): https://pypi.org/project/yt-dlp/
- Supported sites list: https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md