How do I save the buffered flash video (on Linux)?

5

2

There used to be a method for extracting buffered flash video in any browsers (like firefox, chrome, etc.), which makes use of the command ps and spies the fd that is pointing to an in-memory temporary file. Unfortunately, this method doesn't work any more. For example, all fd used by chromium is:

chrome    19412  ymf   69u   REG   0,14   470364     0  270129 /dev/shm/.org.chromium.Chromium.1fzPuo (deleted)
chrome    19412  ymf   77u   REG   0,14   131060     0  270141 /dev/shm/.org.chromium.Chromium.94K6Di (deleted)
chrome    19412  ymf  103u   REG    8,5     2052     0 4230990 /var/tmp/etilqs_01QDHFotJcLOpBS (deleted)
chrome    19412  ymf  112u   REG    8,5    24600     0 4232788 /var/tmp/etilqs_tFao7GamL5cslaZ (deleted)
chrome    19412  ymf  188u   REG    8,6    16384     0 1310851 /home/ymf/.config/chromium/Default/History Index 2013-07-journal (deleted)
chrome    19412  ymf  189u   REG    8,5    16400     0 4232787 /var/tmp/etilqs_D5p3BT7rtTSWLsy (deleted)

None of them contains media content.

And I firmly believe that there's someway we can grip the playing video (on Linux), since the video is streamed from the server whenever we play it (without the help of any browser-specific plugins).

Determinant

Posted 2013-07-22T09:02:42.850

Reputation: 960

3I use DownloadHelper extension on Firefox and it extracts most media content. – Boris_yo – 2013-07-22T09:44:13.570

On Windows I use VideoCacheView. Are you looking for a LINUX specific solution here ?

– Ankit – 2013-07-27T07:59:54.203

@Lamb Yes. I'll add this clarification to my post. – Determinant – 2013-07-27T08:09:50.183

Have you already tried everything here: http://www.kirsle.net/blog/kirsle/download-any-flash-video-in-linux (Does everything on that site fall under the old method you mentioned?)

– A.M. – 2013-07-31T04:23:09.917

Are you aware that chrome is not chromium and that chrome uses peperflash? – Braiam – 2013-08-02T04:24:33.413

@Braiam Sorry, I wasn't aware of that. And BTW, I'm using chromium. – Determinant – 2013-08-02T04:53:26.407

Answers

1

You say "all fd used by chromium is: ... None of them contains media content." but you list very few open files that look all owned by a single process. Not how typically chrome runs. How did you get that info?

On my machine (Linux Mint and Chrome 28.0.1500.95) I could retrieve a streamed flash file right in the place you were looking for it. I suspect you're missing something in the process.

First, you need to identify the process that is running pepper and find the file descriptor id corresponding to your file.

This is possible thanks to /proc and the per-process fd directory

With the video open in a browser window, run this command:

for ID in $( pgrep chrome ) ; do ( sudo ls -l /proc/$ID/fd|grep Pepper ) && echo /proc/$ID/fd; done

The output will be similar to:

lrwx------ 1 root root 64 ago  2 12:52 29 -> /home/me/.chromecache/Default/Pepper Data/Shockwave Flash/.com.google.Chrome.ulDLo0 (deleted)
/proc/1196/fd

Ignore the path the link it's pointing to: it's deleted. You need to access the file via /proc/$PROCID/fd/$FDID

In the example above you would run:

sudo cat /proc/1196/fd/29 > my_video.flv

[EDIT]

To do the same for chromium, change the process name from google-chrome to chro and the string to look for in the file name to /tmp/Flash like so:

for ID in $( pgrep chro ) ; do ( sudo ls -l /proc/$ID/fd|grep /tmp/Flash ) && echo /proc/$ID/fd; done

[EDIT] (again)

This one-liner should work with both chrome and chromium (at least it did on my machine):

for ID in $( pgrep -f chro ) ; do ( sudo ls -l /proc/$ID/fd|egrep "(/tmp/Flash|Pepper)" ) && echo /proc/$ID/fd; done

silviot

Posted 2013-07-22T09:02:42.850

Reputation: 313

How about chromium? I can't find Pepper. – Determinant – 2013-08-02T11:34:16.837

@ymfoi I updated the answer with a command for chromium. Is that working for you? – silviot – 2013-08-02T12:24:39.320

Unfortunately, no outputs. :( – Determinant – 2013-08-02T12:45:26.383

Maybe the version problem? My version is Version 29.0.1547.22 (211613). – Determinant – 2013-08-02T12:46:35.013

Re-updated (I have chromium version 28 though) – silviot – 2013-08-02T15:09:05.673

Still doesn't work. Thanks anyway, this is the best answer I can get so far. And thank you for your patience. :) – Determinant – 2013-08-02T16:07:54.537

1

You could also use @silviot's method in a script:

#!/bin/bash
#
# Show all chrome cached video files!
#
for ID in $( pgrep chrom ) ; do 
    sudo ls -l /proc/$ID/fd|grep Pepper|cut -d' ' -f9|sed "s/\(.*\)/\/proc\/$ID\/\1/g"
done | grep -v '^$'

I have not tested this with more than 1 videos running, but it should work.

urban

Posted 2013-07-22T09:02:42.850

Reputation: 291

-2

I tried all the extensions which get disallowed and then you have to update all the time. Then stumbled onto this: Use the KeepVid.com bookmarklet. Just drag the button on the web page to your bookmarks bar. Just click the link while watching a video

JeLiCaGe

Posted 2013-07-22T09:02:42.850

Reputation: 1