I thought my son might want, or even need, to use this at some point during his time in college. Never fear, the instructions will work even for those of you that are not my progeny. When I was using Linux I used the youtube-dl CLI application to download YouTube videos, and it also works on macOS.
First you need to install the Homebrew package manager:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" (you may have to add sudo before the command and enter your password when prompted).mymacbookpro:~ stevejobs$type brew install youtube-dl and wait a few seconds for it to finish downloading and installing.youtube-dl [URL] where [URL] is the URL of the video in question. Again, pasting the URL might be a good idea. For instance, to download the 1940 Cary Grant classic His Girl Friday (public domain of course) you would type youtube-dl https://www.youtube.com/watch?v=-kpXX501COcThe video will be downloaded and saved to your home folder not your Downloads folder. If your home folder is not in the sidebar of Finder you can either put it there by opening Finder | Preferences and ticking the appropriate box (see image), or from the menu click Go | Home, or simply type SHIFT+CMD+H. For those interested, there are a lot of options you can pass to youtube-dl. You can see a list of options by typing youtube-dl --help.
A lot of videos will be downloaded in .mp4 format, but your may run into .avi, .webm, and other formats. For playing videos not purchased or rented from Apple I highly recommend VLC media player. Hopefully someone finds this helpful. Son, quit reading my blog and get back to studying...or playing vidya games...whichever.