Download YouTube video files with youtube-dl
Did you know that you don't necessarily need flash to view YouTube videos? You don't actually need to even visit YouTube to be able to watch a cool video that a friend gave you a link to.
All you need is youtube-dl, a neat program written and actively maintained by Ricardo Garcia Gonzalez which allows you to download a YouTube video directly as a
.flv file which can be played with mplayer or VLC.
Just follow these three easy steps to download your first video.
- 1. Download youtube-install script
- 2. Run the youtube-install script in the terminal as root (e.g.
- 3. If the script says "youtube installed" you can start downloading YouTube videos like this:
youtube-dl URL, where "URL" is your YouTube video URL.
The .flv file will be downloaded in the current working directory. It's name wont be the actual name of the video, but will look more like a code, but you can easily rename it to something more appealing, unless of course, you intend to just view and get rid of it.
EDIT: Script updated. (Downloads to /tmp first and then moves to /usr/local/bin, to prevent having broken files in that path in case download is unsuccessful).
NOTE: A great alternative to the youtube-dl script is KeepVid.com which allows you to drop the video URL, select the video site it is from (yes it supports even more than YouTube) and just click download. Most files will have an ugly file name, but you can rename it to something.flv. VLC will play them fine!
Even better, if you use Firefox, is a Easy youtube video downloader add on which puts download links right on the description box of the video.