Here's a simplified version of a bash script that reads your firefox cache, finds flash files over a certain size, saves them in directory and opens the directory with nautilus to browse the extracted videos/flash files:
#!/bin/bash
# flvcache script
CACHE=~/.mozilla/firefox/xxxxxxxx.default/Cache
OUTPUTDIR=~/Videos/flvs
MINFILESIZE=2M
for f in `find $CACHE -size +$MINFILESIZE`
do
a=$(file $f | cut -f2 -d ' ')
o=$(basename $f)
if [ "$a" = "Macromedia" ]
then
cp "$f" "$OUTPUTDIR/$o"
fi
done
nautilus "$OUTPUTDIR"&
Remember to chmod 755 the file so you can execute it from the command line.
Change the variable CACHE to your firefox cache location, it'll be somewhere like: ~/.mozilla/firefox/xxxxxxxx.default/Cache
Create a directory to save them into, I chose:
mkdir ~/Videos/flvs
I hope somebody finds this useful.
The script is presented in a simplified format to show bash scripting, you can see how to: use a for loop using bash, load output from external programs into a variable using bash and use an if statement using bash.
thanks, this works great, I can keep a copy of any good video I watch online
ReplyDeletethanks a lot it works great!
ReplyDeleteGreat work. Your script will be featured on Episode 196 of Category5 Technology TV.
ReplyDeleteThanks for sharing this with the community!
Thank you, was very helpful.
ReplyDeleteI used a version of this script in combination with a proxy rule in order to save Pandora music. Thanks!
ReplyDeleteThanks :)
ReplyDeleteThank you!
ReplyDeleteThanks, but it doesn't work now for Youtube. Regards
ReplyDelete