In Maverick, there was an option to download Flash videos from sites like YouTube, Vimeo, etc. by copying the flashxx** file in /tmp directory to another location before closing the window. But in Firefox 4 in Natty, this doesn't work anymore. Why?
- 73,717
- 1,551
21 Answers
You can use several Firefox addons in order to extract the FLV files from many websites such as Youtube.
I'll show below how to do this MANUALLY with the latest version of the Flash plugin.
- Visit the YouTube video and wait for it to be downloaded fully.
Then, run from the command line the command
$ lsof -n | grep Flashwhich shows the files (even memory files!), and filters to those that have
Flashin their name.You get something like
plugin-co 2461 user 17u REG 8,5 1693301 524370 /tmp/FlashXXVkHEM6 (deleted).Now, there is a
/tmp/FlashXXVkHEM6but it has been deleted.In Linux, if a file is deleted, it is actually gone only when all programs that opened it earlier are closed. That is, the Flash plugin is using a trick to hide the /tmp/FlashXXVkHEM6 file. It creates it and immediately
deletesit. But since the Flash plugin keeps running, it can apparently still use it.From the above line we note the number
2461, which is the process ID. In your case it will be probably different. Then, run$ cd /proc/2461/fdand finally execute
$ ls -lThis will show you the memory files, and specifically
lrwx------ 1 user user 64 2011-09-16 10:23 17 -> /tmp/FlashXXVkHEM6 (deleted)The number '17' (in my case) is the filename you can use to access the deleted
/tmp/FlashXXVkHEM6. Therefore, simply run$ cp 17 /tmp/myyoutubevideo.flvand you restore the Youtube Video!
That's it! You manually recovered the Youtube video!
An update to the flash plugin changed the location from /tmp to the Firefox cache directory (e.g. ~/.mozilla/firefox/bq95m4w1.default/Cache). Unfortunately the cached flash file is not as easy to find as before, but it is possible.
The following command lists all the flash files in your Firefox cache.
find ~/.mozilla/firefox/*.default/Cache -type f -exec file {} \; | grep Flash
On Newer versions of ubuntu try
find ~/.cache/mozilla/firefox/*.default/Cache -type f -exec file {} \; | grep Flash
If you navigate to your /proc folder, you will see a bunch of folders all named numerically, including a folder which matches the number in the second field.
Now navigate to this folder, then its subfolder “fd”. In this folder, you will see a whole selection of numbers. These relate to the file descriptors themselves.
Run ls -l in this folder, and you will see that each of these numbers is linked to either pipes, sockets or files.
Within this, the number from the fourth field will be symbolic linked to the /tmp/Flash* file we found before.
To test that this is the right file, you can run it through mplayer or vlc (mplayer filedescriptornumber/vlc filedescriptornumber).
If you’re having trouble finding the filename, try ls -l | grep Flash.
For easy way try this command in console:
stat -c %N /proc/*/fd/* 2>&1|awk -F[\`\'] '/Flash/{print$2}'
The output will be something like this:
/proc/4691/fd/17
/proc/4691/fd/18
That will list all your downloaded flash streams. For that example, there are 2 flash videos from my firefox 4 browser. If you want to copy it, simply use this command:
cp /proc/4691/fd/17 ~/Videos/Flash/sample.flv
Source: http://n00bsys0p.wordpress.com/2011/02/10/how-to-download-flash-10-2-video-streams-in-linux/
- 908
- 3,054
This little script would save your downloaded flash files to a custom directory.
make the directory of where you want the files to be saved eg ~/Videos/flvs
mkdir ~/Videos/flvsopen gedit and copy and paste this script.
#!/bin/bash # flvcache script CACHE=~/.mozilla/firefox/*.default/Cache OUTPUTDIR=~/Videos/flvs MINFILESIZE=2M for f in `find $CACHE -size +$MINFILESIZE` do cp "$f" "$OUTPUTDIR/$o" done nautilus "$OUTPUTDIR"&save the file as saveflashall.sh, then add executable permissions to the file
chmod +x saveflashall.shthen run it.
./saveflashall.sh
it would then open the files in the first folder created above. Customised to include all files ( worked for mpeg and mp4) instead of only flvs.
Credits goes to http://desdecode.blogspot.com/2011/04/saving-watched-online-videos-linux.html
As far as i know this is not due to firefox nor natty, but a flash update...
You can catch the http stream with wireshark or use a tool like youtube-dl to get the movie file.
But remember that it might not be legal, so check your local legislation...
- 14,913
Ubuntu 12.04 (Precise) - Firefox 11 Instructions A modified version of chlumma1's bash script.
With a text editor, save the code below into file named "getvids.sh". Move it to the location you want to save videos. Right-click on the file, go to Properties, Change the Permissions to "Allow executing as a program".
All you have to do is click the script, select "Run in Terminal", and it will save all video files to that directory. To save the whole video, it has to be finished loading in your browser. It will save videos from almost any website, including youtube, vimeo, dailymotion, metacafe, liveleak, facebook. Just delete any video files you don't want.
(If a video you want is not getting saved, then the website is probably using a proprietary stream format that can't be saved by any cache retrieving program. Examples: Hulu, netflix, some youtube videos?) Also, VLC player is a great for watching flash videos.
#!/usr/bin/env bash
# getvids.sh [save_folder]
SAVE_FOLDER="$HOME" # User editable
# If the below option is used, then this script should be run in a terminal.
#CPMOD="-i" # Uncomment to prevent file overwrites
PATERN="libflashplayer"
ALL_PID=`pgrep -f $PATERN`
if [ $? -eq 1 ]; then
echo ERROR: Flashplayer not running
exit 1
fi
if [ ! -z $1 ]; then
echo "Setting save location: $1"
SAVE_FOLDER="$1"
fi
if [ ! -d "$SAVE_FOLDER" ]; then
echo "Save location doesn't exist: $SAVE_FOLDER"
exit 1
fi
for PID in $ALL_PID; do
declare -a OUTFILES=($(ls -lt1 /proc/$PID/fd | grep '/tmp/Flash' | sed 's/^.*\/tmp\///' | sed 's/\ .*$//'))
declare -a FDS=($(ls -lt1 /proc/$PID/fd | grep '/tmp/Flash' | awk '{ print $9 }' ))
for ((i=0; i<${#FDS[@]}; i++)); do
saveas="$SAVE_FOLDER/${OUTFILES[i]}.flv"
echo "Copying video ${FDS[i]} to $saveas"
cp $CPMOD "/proc/$PID/fd/${FDS[i]}" "$saveas"
done
done
Those who know a bit about the terminal can edit the first two variables and achieve a little extra functionality. Alternatively, to view the files live, you can type this in a terminal to find out where they are for i in $(pgrep -f libflash); do find /proc/$i/fd/ -ls | grep "/tmp/Flash" | awk '{ print $11 }'; done
PS. Also, excellent work chlumma1, but lay off the C programming style loops a bit ;)
- 4,627
Recent versions of the flash plugin hide the temporary file by marking it deleted. Practically the video stream is downloaded to a "deleted file". However, even when a file is deleted, if the file is opened by a process then you can find its file descriptor and consequently the file contents.
This simple script prints out the file descriptors of opened Flash videos:
file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d:
And, you probably want to create a regular file from the file descriptor, for example:
cp $(file /proc/*/fd/* 2>/dev/null | grep Flash | cut -f1 -d: | head -n 1) video.avi
Otherwise the file descriptor is not very convenient (remember, it's a deleted file!)
The method should work regardless of your browser.
- 4,968
Hey, this problem already existed in 10.10. So in order to solve it try this:
None of the methods described by previous posters are as convenient as just copying the flash file from the tmp directory.
Therefore, what I did was downgrade my Flash to 10.1.102.64
The download link for older versions of flash is http://kb2.adobe.com/cps/142/tn_14266.html
Download the (large) file named "Flash Player 10.1.102.64 and 9.0.289.0".
After downloading, extract the file named flashplayer10_1r102_64_linux.tar.gz
From this file extract libflashplayer.so and overwrite the file at /usr/lib/flashplugin-installer (you will need root privileges, try gksudo nautilus)
Restart Firefox and your flash videos will land up in the /tmp directory as before! This won't work for Google Chrome, it will continue to use the latest version of Flash.
Note: For the above steps to work, a version of Adobe Flash should have been previously installed.
[quoted from this site: posted by chetancrasta View Post]
I hope this will help you. Let me know if this'll work.
- 21
For a generally applicable method which works with chrome or firefox try this little program called flashcache. It copies flash videos currently being played back to the current directory.
My patch adds the option -p which makes the script play back the videos using mplayer instead of making copies of the files.
- 7,414
I use SMplayer YouTube. It comes with Smplayer that you install in ubuntu software center. It record youtube videos. very simple and easy to use.
- 11
follow this link (~/.mozilla/firefox/ewzggcll.default/Cache)
Unless I'm really confused (don't think so), that "ewzggcll" will not be in your machine. What you will find there is a random collection of letters (and possibly numbers?) that's very likely to be unique to your Linux and Firefox installation. Nevertheless, this odd-looking random collection is important, because it's essential for getting at the cache[s].
Hope this helps! (HTH)
This script will do that:
#!/bin/bash
PATERN="libflashplayer"
ALL_PID=`pgrep -f $PATERN`
if [ $? -eq 1 ]
then
echo ERROR: Flashplayer not runnig
exit 1
fi
for PID in $ALL_PID
do
OUTFILES=`ls -lt1 /proc/$PID/fd | grep '/tmp' | sed 's/^.*\/tmp\///' | sed 's/\ .*$//'`
INFD=`ls -lt1 /proc/$PID/fd | grep '/tmp' | cut -f 9 -d \ `
# nazev souboru do pole
i=0;
for out in $OUTFILES
do
i=`expr $i + 1`
NAMEFILE[$i]=$out
done
# nazev file desktiptoru do pole
i=0;
for out in $INFD
do
i=`expr $i + 1`
NAMEFD[$i]=$out
done
# ulozeni video dat
i=0;
for outfd in $OUTFILES
do
i=`expr $i + 1`
#echo ${NAMEFILE[$i]} ${NAMEFD[$i]}
cat /proc/$PID/fd/${NAMEFD[$i]} > ${NAMEFILE[$i]}.flv
done
done
You can also use keepvid.com for many video streaming sites. It does require java to be on your machines though. Once installed simply paste in the url link and save it in a variety of formats including mp4 or WebM
- 121
Thats still possible.
You can use the shell script from this post about how to open/play all Flash videos with VLC.
To copy all of the videos you have to replace in the last line of the script vlc by cp and provide a destination directory at the end of the same line.
- 1
easiest method is to use the "CacheViewer Continued 0.8" addon for firefox
after installing press ctrl + shift + c to open and then press show all , there after u can search for a particular cache like jpeg , flv anything ......left click on the item will give u the option to save , save it by giving the required extension like .flv for flash video and .jpeg for jpeg and vice versa 
link for the addon https://addons.mozilla.org/en-US/firefox/addon/cacheviewer-continued/?src=api
- 1,377
Mozilla seems to change the location too frequently. Further, the name of buffer is not the same as the video, so finding out the corrent one from the heap is also difficult. So saving the cached file is not a consistent solution. If installing a desktop program is ok, ClipGrab is the best tool out there. You can
- Search for videos.
- Select quality of youtube video to download.
- Select format of video to download.
- You can just give a youtube video URL and it will download the file.
- 117
Hope this will help you http://sahanlm.blogspot.com/2012/05/how-to-copy-google-chrome-cache-flash.html
- 9