Author Topic: copy flash video from firefox cache  (Read 13962 times)

Conker

  • Newbie
  • *
  • Posts: 1
copy flash video from firefox cache
« on: March 17, 2009, 03:43:50 AM »
Here are two batch files that use trid.exe & perl.exe to copy flash video from firefox cache.

Code: [Select]
@echo off
rem Firefox Cache, Copy Most Recent Flash Video
cd %USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Profiles\*.default\cache
trid C:* |^
perl -pe "chomp" |^
perl -pe "s/File:/\n/g" |^
perl -ne "print if /\.FLV/" |^
perl -pe "s/^( C:[0-9A-Z]{8}d01).*/\1/" |^
perl -pe "chomp" |^
perl -pe "s/^/\@dir \/b\/o-d/" > dir.bat
call dir.bat |^
perl -ne "print if $.==1" |^
perl -pe "s/(.*)/copy C:\1 cache.flv > nul/" > copy.bat
call copy.bat
del dir.bat copy.bat

Code: [Select]
@echo off
rem Firefox Cache, Copy All Flash Video, Sort by Date
cd %USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Profiles\*.default\cache
trid C:* |^
perl -pe "chomp" |^
perl -pe "s/File:/\n/g" |^
perl -ne "print if /\.FLV/" |^
perl -pe "s/^( C:[0-9A-Z]{8}d01).*/\1/" |^
perl -pe "chomp" |^
perl -pe "s/^/\@dir \/b\/od/" > dir.bat
call dir.bat |^
perl -pe "s/(.*)/copy C:\1 cache.$..flv > nul/" > copy.bat
call copy.bat
del dir.bat copy.bat

Here are two batch files that use trid.exe, tr.exe & sed.exe to copy flash video from firefox cache.

Code: [Select]
@echo off
rem Firefox Cache, Copy Most Recent Flash Video
cd %USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Profiles\*.default\cache
trid C:* |^
tr -d "\n\r" |^
sed "s/File:/\n/g" |^
sed "/\.FLV/!d" |^
sed -r "s/^( C:[0-9A-Z]{8}d01).*/\1/" |^
tr -d "\n\r" |^
sed "s/^/@dir \/b\/o-d/" > dir.bat
call dir.bat |^
sed "1!d" |^
sed -r "s/(.*)/copy C:\1 cache.flv > nul/" > copy.bat
call copy.bat
del dir.bat copy.bat

Code: [Select]
@echo off
rem Firefox Cache, Copy All Flash Video, Sort by Date
cd %USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Profiles\*.default\cache
trid C:* |^
tr -d "\n\r" |^
sed "s/File:/\n/g" |^
sed "/\.FLV/!d" |^
sed -r "s/^( C:[0-9A-Z]{8}d01).*/\1/" |^
tr -d "\n\r" |^
sed "s/^/@dir \/b\/od/" > dir.bat
call dir.bat |^
sed "=" |^
sed "$!N;s/\n//" |^
sed -r "s/^([0-9]+)([0-9A-Z]{8}d01)/copy C:\2 cache.\1.flv > nul/" > copy.bat
call copy.bat
del dir.bat copy.bat

If batch is too slow, then use triddefspack.exe and video-flv.trid.xml to create a new definition file.

Here is another batch to copy files with a user given file type from firefox cache.

Code: [Select]
@echo off
rem Firefox Cache, Copy All File Type, Sort by Date
if "%~1"=="" goto :eof
cd %USERPROFILE%\Local Settings\Application Data\Mozilla\Firefox\Profiles\*.default\cache
trid C:* |^
perl -pe "chomp" |^
perl -pe "s/File:/\n/g" |^
perl -ne "print if /\.%~1/i" |^
perl -pe "s/^( C:[0-9A-Z]{8}d01).*/\1/" |^
perl -pe "chomp" |^
perl -pe "s/^/\@dir \/b\/od/" > dir.bat
call dir.bat |^
perl -pe "s/(.*)/copy C:\1 cache.$..%~1 > nul/" > copy.bat
call copy.bat
del dir.bat copy.bat

For example, "myscript.bat png" would copy files with file type .PNG from firefox cache.

Thanks Mark0 for a great utility!

PS-

Mark0, maybe give a warning when triddefspack.exe is about to overwrite triddefs.trd or create a .bak file.
« Last Edit: March 23, 2009, 04:23:20 AM by Conker »

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Re: copy flash video from firefox cache
« Reply #1 on: March 17, 2009, 11:31:03 AM »
Hi Conker!
Thanks for the interesting script! I'm sure it will be useful.
I'll add the .bak file / warning on the to-do list!

Bye!