Your Daily Tech-Byte
Watching videos on YouTube is great fun. Loads of videos are uploaded everyday including music videos, movie trailers, T.V. shows etc. But what about saving your favorite videos on your hard drive? It’s easy if you use Windows as you can extract the videos from your web browser’s temporary internet files folder. But doing this work on a Linux distro like Ubuntu can be difficult for some people, especially for people who are new to Linux. It may seem uneasy but it’s not that hard.
You can make use of the commands in Ubuntu to save your videos. ‘youtube-dl‘ is a small command-line program to download videos from YouTube. Firstly, you will need to install ‘youtube-dl’ in Ubuntu.
To do so, give the following command at the terminal:
sudo aptitude install youtube-dl
Using youtube-dl is easy. Use youtube-dl followed by a YouTube video URL to download the video.
For example: youtube-dl “http://www.youtube.com/watch?v=xyz”
Here the video be saved to the file xyz.flv. Since YouTube videos are encoded in Flash Video format, their extension is .flv.
You can change the file name of a video using the -o option.
For example: youtube-dl -o myvideo.flv “http://www.youtube.com/watch?v=xyz”
In this case the video will be saved as myvideo.flv.
You may have noticed that some videos require you to login before playing them. It’s so because these videos have been flagged as containing mature content. To download such videos, you can pass the program the username and password for your YouTube account with the -u and -p parameters.
For example: youtube-dl -u yourusername -p yourpassword “http://www.youtube.com/watch?v=xyz”
Here you username is ‘yourusername’ and password is ‘yourpassword’.
Now you can download your favourite videos and save them on your hard drive on Ubuntu too. Keep them and play them whenever you want.
Craig
August 4th, 2008 at 12:26 pm
Thanks a lot man!! this trick is really cool.
YouTube Vidoes!
August 10th, 2008 at 5:01 pm
Thanks for the informative post.. and thanks for adding our comment to the blog. I am subscribing to your feed so I don\’t miss the next post!
OfNoNation
May 19th, 2011 at 1:12 pm
It’s very simple to grab any Flash flv file from Youtube, or any other Flash video site, without any extra software.
While a Youtube video is playing in your browser, the flv file will be loading into the ‘/tmp’ directory (‘file system/tmp’ in Nautilus) on your hard disk with a name like ‘FlashXXcWWueH’ (no file extension) and will remain there till you close the browser page. Once the video is fully loaded you can copy and paste it to wherever you want to store it before you close the Youtube page.
Remember that if you pause the video on the browser player the file will continue to download to completion in the tmp directory.
I do around 10 at a time in separate Firefox tabs (right-click a link and select ‘open in new tab’, then start the video and pause it once it’s started loading) and come back after a while to copy/paste them into my video clips directory. I then rename them and add the ‘.flv’ extension, though that’s not necessary if they are only to be played on a Linux machine.