Most of the websites which allow free download for YouTube videos look extra sketchy, so I recommend using the yt-dlp library to download videos.
1. Installation
Install the software with your tool of choice:
- Python:
pip install -U yt-dlp - Linux:
sudo apt install yt-dlp - MacOS (brew):
brew install yt-dlp
2. Download the video
Use the following command to download your video:
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]" -o "video.mp4" --merge-output-format mp4 "https://www.youtube.com/watch?v=<ID>"
Explanation:
-
-f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]"- Picks the best video and audio streams that are in MP4-compatible formats.
-
--merge-output-format mp4- Ensures the final merged file is in MP4, not MKV.
-
-o "video.mp4"- Saves the output as
video.mp4.
- Saves the output as