Download a video with a defined format, in this case the best mp4 video available (default is "bv\*+ba/b")

yt-dlp

  • A youtube-dl fork with additional features and fixes.
    Download videos from YouTube and other websites.
    More information: <https://github.com/yt-dlp/yt-dlp>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

yt-dlp --format "{{bv*[ext=mp4]+ba[ext=m4a]/b[ext=mp4]}}" "{{https://www.youtube.com/watch?v=oHg5SJYRHA0}}"

click the source code to copy