Flash Video Cache Finder

Various Gnome Stuff

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.3

Available as/for:
Description:
Find cached video while watching and without needing downloader extensions. Type moz at a prompt to find the vid. Tested with Firefox (Icecat), Chromium, Midori, Uzbl, Konqueror, and Arora.

To install, append the downloaded moz() function to your local .bashrc file. It will work at your next login.
Last changelog:

Speedup again and this time actually find the correct file descriptor.

Look for lsof instead of hard-coded path and graceful exit if no vid found.

1.0 will now find any number of simultaneous videos. Will only find the first instance of uzbl-tabbed.

1.1 Fixed a rather massive error where references to ~/.adobe/Flash_Player were incorrectly pick up.


Ratings & Comments

14 Comments

phillipe

Hi man! You can simplify the method to verify if LSOF really exists, here is what you can do: -# Make sure we have lsof -if [ -x /usr/bin/lsof ]; then - LSOF=/usr/bin/lsof -elif [ -x /usr/sbin/lsof ]; then - LSOF=/usr/sbin/lsof -elif [ -x /usr/local/bin/lsof ]; then - LSOF=/usr/local/bin/lsof -else - echo "lsof was not found... exiting" - return 1 -fi +# Make sure we have lsof +if [ -x `which lsof` ]; then + LSOF=`which lsof` +else + echo "lsof was not found... exiting" + return 1 +fi

marcaemus

Fair enough, but I wanted to check explicitly because, for example, /usr/sbin is not in my users' $PATH so 'which' would not work here.

phillipe

Simple... Just export a custom PATH: # Make sure we have lsof export PATH=$PATH:/usr/sbin if [ -x `which lsof` ]; then LSOF=`which lsof` else echo "lsof was not found... exiting" return 1 fi

marcaemus

And that would leave $PATH set with /usr/sbin in it which is not what I would want.

phillipe

But it can be only while the function is executed: PATH_ORIG=$PATH export PATH=$PATH:/usr/sbin And on the end of the function: export PATH=$PATH_ORIG

marcaemus

What I've written is the simplest and quickest (in execution) lookup for lsof. So my original function is still the best version of this quick hack.

phillipe

Ok man! I just wanted to show you another way to do that without make many validations. Anyway this is a very useful script.

marcaemus

This was just a 90 second hack very early this morning. It is, like me, ugly but very effective.

marcaemus

Added the least bit of error checking for a less brain-dead script.

lordix

Hello. To operate in archlinux: moz () { ME=`/usr/sbin/lsof | grep Flash | tail -n1 | awk '{ print $2 " " $5}'` VID=`echo $ME | awk '{ print $2 }'` PROCDIR=`echo $ME | awk '{ print $1 }'` echo "Video is at "${VID%?} cd /proc/$PROCDIR && cd fd cp ${VID%?} ~/flv/video-${VID%?} } Edit line 2 Edit line 6 +++ cp ${VID%?} ~/flv/video-${VID%?} Copy flv file in ~/flv

marcaemus

Should have searched for lsof instead of hard-coding. Will update in next version.

marcaemus

Also, what was the need to change line 6?

marcaemus

Written a script (not a function) to copy video to your home directory. Usage "mozz [filename]" will copy the cached video to $HOME/flvs/filename.flv.

marcaemus
Pling
0 Affiliates
Details
license
version 1.1
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

More Various Gnome Stuff from marcaemus:

Save cached video
marcaemus
last update date: 13 years ago

Score 5.3

Flash vid finder for Browsers
marcaemus
last update date: 14 years ago

Score 6.3

Other Various Gnome Stuff:

Karuna OS Logo
JCL
last update date: 18 years ago

Score 5.0

Ubuntu for Sony Ericsson z520i
microscopuce
last update date: 18 years ago

Score 5.0

Ubuntu Studio for SE z520i
microscopuce
last update date: 18 years ago

Score 5.0

Ubuntu Humunity
noobilus
last update date: 14 years ago

Score 6.1

VDesk - Visual Desktop
AnthonyAMC
last update date: 13 years ago

Score 5.5

Youtube search function for gnome shell
rivetrik
last update date: 13 years ago

Score 5.0