Scriptarchive
findflash.sh
- Details
- Created on Thursday, 18 August 2011 05:43
- Last Updated on Saturday, 13 October 2012 17:15
- Hits: 1528
nd cached Flash player files
Some versions ago the Adobe Flash player stored cached files in /tmp/.
Actually the latest player sill stores the cached files in /var/tmp/ but uses a trick to hide them from the user:
The file is marked as deleted, but the file handler and data on disc still exist.
So what to do if you cached a video and want to save it for later use?
Look up the PID of "libflashplayer.so" (use "ps") and find files which are used by this process (using "lsof").
You will find something like "/tmp/Flash*".
This file does not exist in /tmp/ but we will find the file handler in "/proc/${PID}/fd/".
Just list the content (ls -la) and grep for "Flash".
You will find something like:
lrwx------ 1 blub blub 64 Aug 18 07:53 15 -> /tmp/FlashXXsJu3NC (deleted)
Now you can play the file with "mplayer /proc/${PID}/fd/15" or copy it with "cp /proc/${PID}/fd/15 ~/Desktop/myfile.flv".
This little script will do all the above for you and find any cached file by the Flashplayer
{code brush: bash}
#!/bin/bash
#
#--------------------------------------------------------------------------------
#findflash.sh v2.0, Copyright Bjoern Olausson
#--------------------------------------------------------------------------------
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#To view the license visit
#http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
#or write to
#Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#--------------------------------------------------------------------------------
#--------------------------------------------------------------------------------
#
# This script finds cached Adobe Flash files open in any browser
#
FLASH_PREFIX="Flash"
PIDS=`lsof /tmp | sed -n "s|.* \(.*\) ${USER} .*\(${FLASH_PREFIX}.* \).*|\1|p" | uniq`
FILES=`lsof /tmp | sed -n "s|.* \(.*\) ${USER} .*\(${FLASH_PREFIX}.* \).*|\2|p" | uniq`
if [[ "$1" != "-c" ]] ; then
echo "Use -c to outpute a C&P ready line to copy the files to your Desktop."
echo -e "You can find your currently open Flash files here:\n"
else
echo -e "Use the following line(s) to copy the files to your desktop:\n"
fi
for PID in ${PIDS} ; do
for FILE in ${FILES} ; do
FD=`ls -lAh /proc/${PID}/fd | sed -n "s|.* \(.*\) -> .*${FILE}.*|\1|p"`
LINK="/proc/${PID}/fd/${FD}"
if [[ "$1" == "-c" ]] ; then
echo "cp ${LINK} /home/${USER}/Desktop/${FILE}.flv"
else
echo "${LINK}"
fi
done
done
echo "" {/code}
Content
Resources
www. is deprecated
Play OGG
Qt Ambassador
Latest comments
-
Harmattan on Gentoo
-
My first scientific publication
-
Congrats, Bjoern -- the paper is ...
-
-
OTRtool v0.8.0-r3 released
-
What a pity ... I am searching ...
-
I do not support OTRtool anymore.
-
Hi, I hope your biochemistry ...
-
-
Qualcom GOBI 2000 UMTS/GPS 3G modem with Gentoo (ThinkPad W510)
-
Was helpful :)
-
-
anamo.py 2.1 with accelerated MD output support
-
good
-
-
findflash.sh
-
Fixed! There is no libflashplayer.
-
Hi I have tried the script but ...
-
-
web2sms for N9/N950
-
Ich habe einen Account bei ...
-
Read more...