- Download the best quality video and audio:
youtube-dl -f bestvideo+bestaudio [video URL]
This will download the best quality video and audio available for the specified video URL.
- Download the best quality video and audio as separate files:
youtube-dl -f bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best [video URL]
This will download the best quality video and audio as separate files. The video will be saved in MP4 format and the audio will be saved in M4A format.
- Download the best quality audio only:
youtube-dl -f bestaudio[ext=m4a] --extract-audio [video URL]
This will download the best quality audio only and extract it into an M4A file.
- Download the best quality video only:
youtube-dl -f bestvideo[ext=mp4] [video URL]
This will download the best quality video only and save it in MP4 format.
- Download specific quality video and audio:
youtube-dl -f 720p+140 [video URL]
This will download a video with a resolution of 720p and audio with a bitrate of 140 kbps. You can adjust the quality by specifying different video and audio formats.