-
-
Save idlecool/611495 to your computer and use it in GitHub Desktop.
saving flash videos from firefox chrome cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#The target directory where you want the files to be saved. | |
#With trailing slash. | |
target="$HOME/" | |
cd "/tmp" | |
for i in `ls | grep ^Flash` | |
do | |
#If the file is already copied, let's not copy again. | |
prev_size=0; | |
cur_size=0; | |
if [ ! -f "$target$i" ] | |
then | |
while [ 1 -eq 1 ] | |
do | |
prev_size=`du -s /tmp/$i | cut -f 1` | |
sleep 3; | |
cur_size=`du -s /tmp/$i | cut -f 1` | |
#Let's copy the file only after it has buffered completely. | |
if [ $cur_size -eq $prev_size ] | |
then | |
cp -f "/tmp/$i" $target | |
break | |
else | |
sleep 5 | |
fi | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment