Absolutely Tech

[HowTo] Save all flash video files being played in Chrome/Chromium to Home directory

By: Deepak Mittal

After watching a video on youtube in chrome, I felt like saving it. I couldn’t find the flv in ~/.cache or in /tmp. So I dug around and found this link: http://superuser.com/questions/235535/in-google-chrome-on-linux-where-is-the-flv-if-not-in-tmp.

The solution by omab worked for me. So I wrote this one line command which would save all the currently playing files in Chrome and Chromium in home directory.

A=`ps auwx | grep "flash" | grep "chrom" | awk '{print $2}'`; ls -la /proc/$A/fd | grep Flash | awk '{print $8}' | xargs -I _ mplayer /proc/$A/fd/_  -dumpstream -dumpfile ~/_.flv

Leave your thoughts in the comments!

Cheers!

Category: How-To, Ubuntu (Linux)

Tagged: , , , , ,

  • 3026342

    Thanks a lot! I started using this script. Good work.

  • S. Clark Rubino

    didn’t work for me, nothing is in the home folder, i got some errors like mplayer: no such file or directory, could not connect to socket, and then core dumped ;)  I’m an absolute beginner

    • http://www.geekdevs.com Deepak Mittal

      I just tested and it seems the new flash plugin has again changed the way it works, so its not working for me either. I’ll update the post to reflect the same.

  • http://profiles.google.com/homerj141 Ryan Sharp

    ls: cannot access /proc/fd: No such file or directory
    Any help?

    • Trude Bergh

      I got the same response, strange, because just yesterday I was able to do this:

      save videos
      command: stat -c %N /proc/*/fd/* 2>&1|awk -F[`'] ‘/Flash/{print$2}’
      this gives the file locations
      then copy the file:

      cp /proc/16856/fd/17 /tmp/flash

      but I can’t do that anymore :(

  • anonymous

    wowww.. that really works. thanks

  • foobar

    on debian
    apt-get install movgrabmovgrab -f mp4 http://www.youtube.com/watch?v=-pCRa7DjcEs

  • FMKilo

    script worked for me…

    • FMKilo

      you do have to install all of the used components though.

  • JOhn

    how can I use the script?

=