
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
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.
9 years ago
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.
9 years ago
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.
phillipe
9 years ago
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
Report
marcaemus
9 years ago
Report
phillipe
9 years ago
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
Report
marcaemus
9 years ago
Report
phillipe
9 years ago
PATH_ORIG=$PATH
export PATH=$PATH:/usr/sbin
And on the end of the function:
export PATH=$PATH_ORIG
Report
marcaemus
9 years ago
Report
marcaemus
9 years ago
Report
phillipe
9 years ago
I just wanted to show you another way to do that without make many validations.
Anyway this is a very useful script.
Report
marcaemus
9 years ago
Report
lordix
9 years ago
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
Report
marcaemus
9 years ago
http://gnome-look.org/content/show.php/Save+cached+video?content=146399
Report
marcaemus
9 years ago
Report
marcaemus
9 years ago
Report
marcaemus
9 years ago
Report