Rip Flash Videos from Firefox Cache

First you need to navigate to the folder where Firefox stores its cache:

cd ~/.mozilla/firefox/`cat ~/.mozilla/firefox/profiles.ini | grep -m 1 Path= | awk '{print substr($1,6,length($1)-5)}'`/Cache

In this folder is a load of randomly named files. We have to do some filtering to find the videos we want. Firstly, let's say we only want files greater than 1 megabyte:

find -size +1M

Next, for every file that is found, we wanna check if it's a Flash video file. We use the built-in Linux program called "file" to figure out what kind of file it is:

find -size +1M | xargs file -F " "

Next, we use "grep" to filter out any files that aren't Flash files:

find -size +1M | xargs file -F " " | grep Flash

We can use awk to get the file name on its own:

find -size +1M | xargs file -F " " | grep Flash | awk '{print $1}'

Next I find it's helpful to see the file sizes, because when I'm ripping videos from my Firefox cache I'm usually looking for a fairly decent sized video:

find -size +1M | xargs file -F " " | grep Flash | awk '{print $1}' | xargs ls -lh | awk '{print $9 "    " $5}'

From there just choose a file and copy it to your home folder, and remember to give the file an "FLV" extension:

cp 000aaa000bb ~/some_video.flv

Next you can play it with VLC:

vlc some_video.flv &

Virjacode Home