Tuesday, November 3, 2009

How to save online video

Again there's more than than one way to skin a pu... er... cat. So I give two methods.

Method I : Works in any OS but needs Firefox.
Just add the extension Download Helper https://addons.mozilla.org/en-US/firefox/addon/3006

Method II : Works in Linux.
Open the video in the video streaming website. (Youtube for example)
Let the video load entirely in the browser (Firefox for example).
With the browser still open go to the terminal.
$ ps aux | grep firefox  # or grep your browsers' name
output looks like

12464 Sl 1:42 /usr/lib/firefox-3.0.14/firefox

12464 is the PID for Firefox. Now, let's find out where's Firefox storing the temporary video file. To see that find all open file handles by Firefox.

$ ls -lU /proc/12464/fd

-l option is necessary to see where the handles are pointing to. Output looks like

lrwx------ 1 xxxx academic 64 2009-11-03 15:48 90 -> /tmp/FlashY7mpKM
lrwx------ 1 xxxx academic 64 2009-11-03 15:48 91 -> /var/tmp/etilqs_yZv1nx28NVRfKhh (deleted)
l-wx------ 1 xxxx academic 64 2009-11-03 15:48 92 -> pipe:[2319227]
lr-x------ 1 xxxx academic 64 2009-11-03 15:48 93 -> pipe:[2319228]

Look for file named /tmp/FlashY7mpKM and copy it to the home directory.

$ cp /tmp/FlashY7mpKM ~

Then go to HOME and rename it accordingly.

No comments:

Print chess board in command line

The following bash one-liner will print a chess board in a terminal (the script works for the shells bash and ksh only) for (( i = 1; i ...