Wednesday, March 2, 2011

Continue downloading flash from /tmp

Since the latest version of adobe flash no longer downloads to /tmp,  it places video in the following folders

in firefox / home / user / mozilla / firefox / userprofile / Cache

in opera / home/user/.opera/cache/g_000X

in chromium / home / user / .cache / chromium / Cache

in chrome / home / tuusuario / .cache / google-chrome / Cache

However,  the problem is that the file is deleted when the player finishes playing the stream. So you do not have time to recover.

If you use JDownloader, you can retrieve some videos to the clipboard by simply copying the URL, JDownloader detect the file type and give you several download options .

However, thanks to Ubuntu Life I found a script that lets you create a link in / tmp pointing to the downloaded video (it has been tested in chromium and firefox). This script could run it directly or use it as a nautilus script Here is the link to the original Russian site which showed the way to accomplish this

#!/bin/sh
#
# Flash Temp Link Creator (by shuairan)
#
# description:
# does what has to be done.
# creates symlinks to the file descriptors of buffered firefox flash videos
# because the good old /tmp/FlashXXXX files are immediatly deleted with new flash player 10.2
#
# use at your own risk ;-D
# support, questions, bugs: twitter.com/shuairan or S.Riedinger@gmail.com


#Delete FlashXXXXXXXX symlinks
for i in $(ls -l /tmp | grep -i 'flash[[:alnum:]]\{8\} -> \/proc\/' | cut -d" " -f14); do
echo "Deleling: /tmp/$i"
rm "/tmp/$i"
done




#create new symlinks
for i in $(pgrep -f libflashplayer.so); do
ls -l /proc/$i/fd/* | grep -io '\/.* /tmp/flash[[:alnum:]]\{8\}' | while read line; do
#echo $line
FDFILE=$(echo $line | cut -d" " -f1)
TMPFILE=$(echo $line | cut -d" " -f3)
echo "Create Symlink: $TMPFILE -> $FDFILE"
ln -sf $FDFILE $TMPFILE
done
done

No comments:

Post a Comment