Results 1 to 7 of 7

Thread: Command Line Fun: Rip Flash video from Firefox cache

  1. #1
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default Command Line Fun: Rip Flash video from Firefox cache

    To install the Flash player plug-in, do the following:

    Code:
    wget http://virjacode.com/projects/beefup/dloads/linux_flash.tar.gz
    tar xzf linux_flash.tar.gz
    cd install_flash_player_10_linux
    mkdir /usr/lib/mozilla/plugins
    install -m 0755 libflashplayer.so /usr/lib/mozilla/plugins/
    cd ..
    rm linux_flash.tar.gz
    rm -r install_flash_player_10_linux
    Now open up Firefox, on Youtube or whatever, and watch a Flash video or two.

    Next here comes the command line fun

    First you need to navigate to the folder where Firefox stores its cache:

    Code:
    cd ~/.mozilla/firefox/`cat ~/.mozilla/firefox/profiles.ini | grep -m 1 Path= | awk '{print substr($1,6,length($1)-5)}'`/Cache
    In this folder is a load of randomly named files. We have to do some filtering to find the videos we want. Firstly, let's say we only want files greater than 1 megabyte:

    Code:
    find -size +1M
    Next, for every file that is found, we wanna check if it's a Flash video file. We used the built-in Linux program called "file" to figure out what kinda file it is:

    Code:
     find -size +1M | xargs file -F " "
    Next, we use "grep" to filter out any files that aren't Flash files:

    Code:
    find -size +1M | xargs file -F " " | grep Flash
    We can use awk to get the file name on its own:

    Code:
    find -size +1M | xargs file -F " " | grep Flash | awk '{print $1}'
    Next I find it's helpful to see the file sizes, because when I'm ripping videos from my Firefox cache I'm usually looking for a fairly decent size video:

    Code:
    find -size +1M | xargs file -F " " | grep Flash | awk '{print $1}' | xargs ls -lh
    From there just choose a file and copy it to your home folder, and remember to give the file an "FLV" extension:

    Code:
    cp 000aaa000bb ~/some_video.flv
    Next you can play it with VLC:

    Code:
    cd
    vlc some_video.flv &
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  2. #2
    Junior Member
    Join Date
    Aug 2007
    Posts
    85

    Default

    Thanks boss
    How you spend your time is more important than how you spend your money. Money mistakes can be corrected, but time is gone forever. David Norris

  3. #3
    Just burned his ISO imported_gr8gorilla's Avatar
    Join Date
    Jun 2009
    Posts
    10

    Default

    Thanks, for us geeks out there in the world, stuff like that really is fun. I think that it takes a special kind of geek to appreciate just how cool ripping flash video out of your browsers cache through the command line, really is!

  4. #4
    Junior Member
    Join Date
    Sep 2006
    Posts
    45

    Default

    Thanks for the step by step after every pipe, it's a really helpful way to learn - and i'm sure - explain too!

    Didn't know what awk could do until now, so thanks again.

  5. #5
    Very good friend of the forum Virchanza's Avatar
    Join Date
    Jan 2010
    Posts
    863

    Default

    Thread bumped because I made changes to the initial post:

    1) It is no longer restricted to just Backtrack 4, it will work on Ubuntu or Fedora or whatever.
    2) Added extra points that make it easier to find the videos you want.
    Ask questions on the open forums, that way everybody benefits from the solution, and everybody can be corrected when they make mistakes. Don't send me private messages asking questions that should be asked on the open forums, I won't respond. I decline all "Friend Requests".

  6. #6
    Just burned his ISO Steel9's Avatar
    Join Date
    Mar 2009
    Posts
    10

    Default

    Thank you Virchanza:

    #!/bin/bash
    cd ~/.mozilla/firefox/`cat ~/.mozilla/firefox/profiles.ini | grep -m 1 Path= | awk '{print substr($1,6,length($1)-5)}'`/Cache
    find -size +4M | xargs file -F " " | grep Flash |awk '{print $1}' | xargs ls -lh
    echo $1
    echo " "
    echo "Enter the name of the Flash file"
    read FLASH
    cp $FLASH ~/some_video.flv
    echo " "
    echo $FLASH "has now been copied to your home directory, Thanks to Virchanza"
    echo " "
    echo Press enter to quit
    read enter

    Maybe someone can help me by showing me a way to just display the flash file name. Other than that it works great on Ubuntu 9.10

    Thanks again.

  7. #7
    Just burned his ISO
    Join Date
    Dec 2009
    Posts
    1

    Default hmm. nice

    uh... bookmarked thoughts )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •