Downloading YouTube videos

Most of the websites which allow free downloads of YouTube videos look extra sketchy and it's hard to find ones that "look safe".

One of the best utilties that fixes this problem is yt-dlp, which I've also incorporated as a utility on this website, so you don't have to download anything 😇

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.