Youtube Streamed Video on Local Disc

I always need to find the Cache of streamed media including youtube’s video in WebM format. Here is my environment

  • Firefox 16.0.2
  • Ubuntu 12.04.1 LTS

There’re two types of YouTube cache in local directory.

  1. WebM
  2.  Macromedia Flash Video

Here I done with the HTML5 but for Flash , the trick is more similar.

Two possible trail and error way you can find the videos:

  1. Locate the WebM cache file (For most medium sized HTML5)
            # HTML 5
            find ~/.mozilla/firefox/*.default/ -type f -size +100k -ls|awk '{printf $11 "\n"}'|xargs file|grep -i webm|awk -F: '{printf $1 "\n"}'
            # Flash Video
            find ~/.mozilla/firefox/*.default/ -type f -size +100k -ls|awk '{printf $11 "\n"}'|xargs file|grep -i 'Flash Video'|awk -F: '{printf $1 "\n"}'
  2. Locate mozilla-media-cache/media_cache (deleted) (For bigger size video)

        # This shows mozilla-media-cache/media_cache (deleted) which is cache of HTML5
        FX=`ps -ef|grep '/usr/lib/firefox/firefox'|grep -v grep|head -1|awk '{printf $2}'`
        if [ $FX != '' ] ; then {
                echo /proc/$FX/fd/;
                ll /proc/$FX/fd/|grep media_cache
        else echo 'No running firefox';return 0;  


Just copy that file to desired location.Enjoy the video in VLC offline.Hope this helps!

You can find updated working version always at my yt() of handy-tools

This entry was posted in linux, technology and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

− 3 = three