Friday, May 20, 2011

How to download flash files, no more in /Tmp



Recently, I noticed that the flash files not in the /Tmp folder anymore, when I watching Youtube's videos. I keep on searching for solution, then I found this usefull script.


#!/usr/bin/env bash
for flashpid in $(pgrep -f flashplayer.so); do
cd "/proc/$flashpid/fd"
for video in $(file * | grep '/tmp/Flash' | sed 's/\(^[0-9]*\).*/\1/g'); do
echo "/proc/$flashpid/fd/$video"
cp "/proc/$flashpid/fd/$video" ~/Downloads
done
done

The steps are:
Paste above script into any text editor. Since I'm using Mint 10, I put in in Gedit. Then save the file as FindFlashFiles.sh (for example, but the extension must be 'sh'). Then make it executable.

Whenever I watching videos in Youtube, I can save the videos in my local hard drive with this tips, by running this script. Yeay !

The script was taken from Linux On Desktop.

No comments:

Post a Comment