Evanescent Thoughts

Evanescent Thoughts

The easiest way to download Youtube videos in Linux :)

with 9 comments

Have you ever wondered to  write an application to download a youtube video in linux ?? If you are too geeky , u can do something so complex like , use awk ( which is string processor ) to download  you tube videos ( refer this ) . But i am in no position to learn awk just to download youtube videos.So i happened to get to my /tmp folder and realised that a cp command  would do the job 😛

Lemme first point out that this method would work for any video that you can watch on your firefox browser ( or any other browser for that matter ) .

All i am gonna do is use a  cp command to download youtube videos. Some times things are so simple in Linux you see.

Say you are watching a youtube video in firefox and want to download ,  you need to do the following .( Donot close the page that hosts the video )

1. Let the video to load completely .

2. Once the video gets loaded completely, open your terminal and do the following :

a=`ls /tmp/Flash*` && cp $a ~/Desktop/1.flv

Voila !!! Thats it .. you are done.. You would find the video in your desktop . Basically when your browser plays the video , it maintains a temporary copy of it in /tmp folder  with a name Flash followed by some string . So in case you wanna download , all you have to do is , before closing the site from which you are viewing the video , copy it on to your hard disk :P. So simple isnt it ??

In case you have more than one video files in the tmp directory , do the following

for i in `ls /tmp/Flash*`
      cp $i ~/Desktop/$(basename $i).flv

And tht should copy all Flash video files into your desktop.

Leave any simpler ways to do if so in the comments 😛 . Also if the above method fails in any case…


Written by Sathya Narayanan

January 31, 2009 at 11:50 pm

9 Responses

Subscribe to comments with RSS.

  1. wow 🙂 didn’t know this. 🙂 cute one 🙂 I don’t think I’ll use keepvid after this 🙂


    February 1, 2009 at 12:49 am

  2. lol.. me neigther gonna go to http://downloadyoutubevideo.com 😛
    actually i noticed this once whn i was viewing a rar file.. whn i tried to view without extracting , it created a copy in my home folder with cryptic file name 🙂

    Sathya Narayanan

    February 1, 2009 at 1:40 am

  3. Sounds like a good way but does it get at all messed up if there is more then one flash thing running in firefox? Say some ads running in another tab?


    February 1, 2009 at 3:17 am

    • hmmm.. sounds like a problem.. but whn u use the second one , it copies all flash files into your desktop… u can then chose which one to retain.. will find out and get back to u if any better solution possible… 🙂

      Sathya Narayanan

      February 1, 2009 at 9:43 am

  4. […] The easiest way to download Youtube videos in Linux « Sathya’s … […]

  5. I prefer using youtubedl. It’s a command line python script which also supports batch downloading.


    September 21, 2009 at 3:39 am

  6. Hi this is nice one…i dont have the flash player in firefox!i have the url only.how can i download the video?


    October 22, 2009 at 12:42 pm

    • check out the awk one which i have given as link . Tht shud work provided youtube hasnt changed how it delivers the videos ..

      Sathya Narayanan

      October 22, 2009 at 5:41 pm

  7. […] might wanna check into this to get a context of what this post is about. With the previous versions of flash, I could get a […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: