1. Install yt-dlp
yt-dlp
yt-dlp • Updated Jan 25, 2026
1.1. With pip
python3 -m pip install -U "yt-dlp[default]"
1.2. With brew
brew install yt-dlp
2. Download video with the best quality
Use this code.
yt-dlp -f "bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]" --merge-output-format mp4 YOUR_YOTUBE_VIDEO_URL
3. Download audio only with the best quality
yt-dlp -x --audio-format mp3 --audio-quality 0 --add-metadata YOUR_YOTUBE_VIDEO_URL
Download every video as audio file in a channel.
yt-dlp -x --audio-format best --audio-quality 0 -o "%(uploader)s/%(title)s.%(ext)s" <CHANNEL_URL>

