Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Google Chrome used to store YouTube videos in /tmp, but not for the last two versions. Nor could I find those files in ~/.cache/google-chrome. Googling for this query produces Windows-specific results. Where are these files stored?

I am using Fedora 14.

share|improve this question
    
I thought those videos weren't stored on disk. Are you using some Extension? Can you check on your home dir. –  Tshepang Feb 14 '11 at 6:48
    
Whenever you play a video from Youtube or similar sites, videos do get stored in /tmp. If I play a video in firefox, these videos are still found in /tmp. But somehow I prefer Google Chrome. Which specific location are you asking me to check in Home dir? I mentioned a path above which I checked but it hasn't got the thing I'm searching for. –  Dharmit Feb 14 '11 at 9:56
    
look in wherever XDG_CONFIG_HOME points to.. try .config/chromium it doesn't make sense but chrome dumps like everything in there, I filed a bug on them abusing it but they closed it because of a side thing I put in it –  xenoterracide Feb 14 '11 at 12:49

4 Answers 4

up vote 18 down vote accepted

Use this Bash script to get a list with all temporarily saved Flash videos:

#!/usr/bin/env bash

for flashpid in $(pgrep -f flashplayer.so); do
    cd "/proc/$flashpid/fd"
    for video in $(file * | grep '/tmp/Flash' | sed 's/\(^[0-9]*\).*/\1/g'); do
        echo "/proc/$flashpid/fd/$video"
    done
done

Mark the script as executable and run, for example to view the videos, the following:

flashget.sh | xargs mplayer

Explanation

Since Flash 10.1, all /tmp file system entries are getting deleted as soon as the Flash player opens them. But the file itself still exists, since the kernel only deletes the file if the hardlinks don't exists anymore. Only the Flash plugin knows where the file/video is. Luckily, the kernel can tell us which processes have which filehandles open. So, there are still hardlinks for these files located at /proc/$PID/fd.

share|improve this answer
    
Whoa!! Awesome. Such a geeky style too!! Thanks a ton.. :) –  Dharmit Feb 14 '11 at 15:03
    
Usint with "flashget.sh" it works really fine. But what does "xargs mplayer" do? For me it gives "xargs: mplayer: No such file or directory", if I try with an existing directory it gives permition denied (even using sudo) –  Tom Brito Feb 20 '11 at 15:23
    
your script and command plays the video in mplayer, but what if you want to copy it and save it? I tried copying the hardlink but it doesn't work and the target says /tmp/FlashXXXXX (deleted). –  user5299 Mar 4 '11 at 6:05
1  
@Lian Just run "flashget.sh | xargs firefox" or "flashget.sh | xargs chromium-browser" (or the browser of your choice) and the browser will ask you to "download" the file. –  Dayjay Mar 7 '11 at 11:52

You can adapt the script found in Play YouTube Videos Without Flash [From /tmp, Works With Adobe Flash 10.2]. It works for me using Google Chrome on Debian.

share|improve this answer
3  
Welcome to Stack Overflow. Please don't just post a link, also describe what's behind that link (here: summarize what the script does). In this case, you'll notice that the script copies files from /tmp, and the asker's problem is that this technique no longer works with recent versions of Chrome. –  Gilles Mar 4 '11 at 21:41

They are stored in /home/<username>/.cache/chromium/Default/Cache

share|improve this answer

I have a simple solution for YouTube videos: Chrome with Fedora 13 and above.

Just change USERNAME in the following command to your current username. Run the first and then the second command so that you will get a shortcut of your cached folder on your desktop.

cd /home/USERNAME/Desktop
ln -s /home/USERNAME/.cache/google-chrome/Default/Cache youtube
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.