7/17/2011

Downloading Videos off of Youtube Using Linux...

Not so long ago grabbing a copy of a video off of Youtube (when running Linux) was easy. All you had to do was open the /tmp folder, and copy-paste the desired video (after it had finished buffering) wherever you wished. Nowadays Adobe setup its player to delete the temp. file immediately after its creation. However, the player still keeps track of the handle to the file. As a result, the file still exists, but doesn't show up via the traditional commands like ls, find, etc...

Luckily, the command lsof can be used to find the file's location.

Steps to find:

Command 1:

lsof | grep Flash

----------------------------

Having done this, you should get a screen-print that looks as follows;

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODENAME


Command 2:

cat /proc/[PID]/fd/[FD] > /desired/location/filename.flv

Note: [FD] typically ends with a letter, which should be excluded from the previous command. Additionally, [PID] and [FD] are variables taken from the output of command one, and should be filled in manually, without the square brackets.

Congratulations, you now have a copy of the video. Enjoy...