Youtube-dl is a powerful multiplatform tool written in Python that allows to download videos from hundreds of video sites just using command line.
It requires the Python interpreter (2.6, 2.7, or 3.2+), a Windows executable that includes Python is provided, so it will work out of the box.
Youtube-dl should work in your Unix box, in Windows or in Mac OS X.
Once downloaded, if you are using Windows O.S. you just need to run it from command prompt, with the –help option you can see how many options are available.
To download a video use the following format:
youtube-dl [OPTIONS] URL [URL...]
Lets see some examples that show you how youtube-dl works.
To see the available quality formats for a Youtube video use the –list-formats option:
youtube-dl --list-formats https://www.youtube.com/watch?v=2Vv-BfVoq4g
Choose the desidered format (the number of the first column named format code) and specify it using the -f option. The default download location is the path where you have youtube-dl but you can change it using the -o option:
youtube-dl -f 137 -o "C:\temp\%(title)s.%(ext)s" https://www.youtube.com/watch?v=2Vv-BfVoq4g
To just extract only audio from a Youtube video and save it in mp3 format you can use the –extract-audio and –audio-format options:
youtube-dl --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=2Vv-BfVoq4g
If you get the error message ffprobe or avprobe not found. Please install one you just need to download FFmpeg, extract it and copy the .exe files from bin folder inside the youtube-dl folder.
To download a Youtube playlist use the following command:
youtube-dl -cik -o "C:\temp\%(title)s.%(ext)s" -–format mp4 -–yes-playlist https://www.youtube.com/playlist?list=PLaq655wqcKDnUvTOizhqwNCiiF_grL1vh
The “c” option means to resume partially downloaded files. The “i” option means to ignore any errors. The “k” means to keep the video on the disk after the post-processing is finished.
Youtube-dl is a fantastic tool that allows to download videos from many sites like Facebook, Vimeo, etc…, you can see the impressive list of supported sites.
Someone has also developed frontends for Youtube-dl, so you can use the tool with a GUI.
One of the most popular is Youtube-DLG, its usage is simple.
Other interesting GUIs are Downline (installer and portable versions for Windows, Linux, Mac), Tartube (Windows and Linux), JackTheVideoRipper (Windows), StreamBuffRe (installer and portable versions for Windows and Linux).