First a disclaimer,it might be illegal to download flash file,it depends upon the website's TOS and I encourage you to go through them before attempting to download flash file, if it is illegal I will NOT recommend that you download flash file.
There are different ways to download flash file, there are plugins that you can install in firefox, there are scripts that allow you to do so, however,one of the better ways that I have used for years( at least more than a year) is copying FlashXXX files from /tmp and renaming them appropriately.
Whenever flash played any media file in the browser, it downloaded Flash file locally in /tmp and deleted it when you closed the page. This had many advantages, for instance if you find something interesting and have already watched it in browser, you do not have to download it again using some plugin, or for instance you could only play part of file by seeking it appropriately and the relevant section is only downloaded in /tmp.
However, I found after updating my system, I no longer had FlashXXX files stored in /tmp , I looked frantically on net to find out reasons for this and found that this has to do with Adobe Flash Player being updated, which no longer saves Files temporarily in /tmp. I further looked up different forums on the Internet and found Flash indeed saved file on the system locally, it was just bit more difficult to access them.
In this post I would try to demonstrate how to retrieve flash files stored locally in the system while it is being played in the web-browser when they are not saved in /tmp. This works with Mozilla Firefox, I haven't tried this with other browsers, though it can work.
One approach to solve this problem would be to downgrade your flash to earlier version, but this is not recommended as updates fix many critical security vulnerabilities and further have performance improvements.
The key to finding flash is the fact that on POSIX based systems, or for instance GNU/Linux all the information about processes running on the system is stored in "/proc" directory were each running process is identified with Process ID and there is a directory corresponding to PID in /proc. Further, all the open File descriptors are maintained here i.e in a lyaman all the information about files opened by process is here.
So if we can find process ID corresponding to the instance of flash player and find the fd corresponding to opened flash file we can easily copy the file and this is the approach that is followed by this script ( I am not the original author of this script) :
Open your favorite text editor and copy the following script, and rename it to something like - findflash.sh
#!/usr/bin/env bashNow, open your favorite flash(ensure it is legal to copy) file in web-browser, and in terminal window execute this file by issuing command :
for flashpid in $(pgrep -f flashplayer.so); do
for video in $(file * | grep '/tmp/Flash' | sed 's/\(^[0-9]*\).*/\1/g'); do
bash findflash.shThis should print the fd corresponding to all the flash files currently playing, copy them using conventional UNIX command and rename it to meaningful name.
The screen shot below illustrates this -
We had opened a video in Firefox, then we executed findflash.sh script, which gave us file descriptors of opened flash video, we copied and renamed this to some meaningful file name and played it using mplayer.
Article Written by : Ambuj Varshney (firstname.lastname@example.org)
For Linux on Desktop Blog , http://linuxondesktop.blogspot.com
(C) 2011 , Ambuj Varshney