Grab That Online Video: Mozilla

Folks, this is way out of date, more than seven years old. It doesn’t work like this any more.

So you run across this instructional video on YouTube, and you would love to keep a copy, since pulling it down over the Net again and again is a lot of hassle. You can use various online services, or scripts and utilities which download from YouTube, but those all mean you will have to download it again.

You do know about this thing called “browser cache”, no?

The Mozilla products (Firefox or Seamonkey) make this pretty easy. If you are persistent, you can probably figure this out for other browsers. I’ll show you the concept, and you can extrapolate if it matters to you. This works best on Linux and Unix style operating systems, but again, extrapolate if it matters to you.

When you visit YouTube and run a video in your browser with FlashPlayer, that thing has to come down the wire and is held in your browser cache. If your connection is slow, perhaps you already know to manually pause the player while it is cached in your browser. That means the video itself is being loaded onto your harddrive. It’s there for awhile afterward. For brainless fools, this is often how police find incriminating graphics on your computer — they run a utility which finds such things. Frankly, most LEOs have no real grasp of the technology.

So your Firefox browser caches this video on your drive. You find it by going to your storage directory, which on Linux is called “home” and the shorthand on the commandline is ~/. In Windows, it’s usually the directory up from “My Documents” then down into some folder called various names, depending on which release of Windows you are running. If it matters, you can figure it out — try Google. On Linux it’s in the ~/.mozilla folder.

Drill down into the folder for either Firefox or Seamonkey, then that randomly named folder, and finally into the one named Cache. There you’ll find a long list of files name with random characters. For every video from YouTube, it will be really very much larger than the average image or webpage. Here’s an excerpt of my listing for the past hour, using ls -l to detect the file sizes:

-rw------- 1 ed ed 77909 2010-06-18 07:53 54D270B0d01
-rw------- 1 ed ed 35442 2010-06-18 08:52 557E93EBd01
-rw------- 1 ed ed 52406 2010-06-18 05:06 55D359CAd01
-rw------- 1 ed ed 11143160 2010-06-18 09:42 55D63A7Dd01
-rw------- 1 ed ed 44846 2010-06-18 07:57 576F0A1Dd01
-rw------- 1 ed ed 16614 2010-06-18 07:15 58610F55d01
-rw------- 1 ed ed 37852 2010-06-18 05:04 58E91957d01

Now, WordPress makes it pretty hard to display this accurately, but you can see on of those is HUGE, at some 11,143,160 bytes. That’s approximately 11MB, which is typical for a short YouTube video. In Linux, we have this utility for the commandline to help identify file types. Here’s the screen scrape of my use; the second line is the response.

$ file 55D63A7Dd01
55D63A7Dd01: Macromedia Flash Video

I had watched only one video at that point, so it’s pretty obvious. Copy to another folder, rename it whatever suits your taste with the “.flv” extension in this case, and test to see if your default video player can handle it. With a Linux system which has all the proper codecs and so forth, it would easily play. In Windows, I believe you have to use something ported over from Linux, like Mplayer, or you can download free players specifically for Flash videos.

Yeah, this method is not so convenient as some of those cute utilities, such as the Mozilla plugin which does it for you. However, it never hurts to understand exactly what is going on under the hood. Perhaps you’ll understand how it is hardly illegal to simply move around the files already on your own harddrive.

I almost forgot: By default, Mozilla products limit their cache space to 50MB. If you start trying to pull longer videos, say more than 10 minutes, you might want to dig around in the preferences menu and increase your cache size to more like 250MB.

And if all you want is the soundtrack from your FLV file, you might want to discover the wonderful world of ffmpeg. Here’s one of my favorite formulas (a single command on one line):

ffmpeg -i SomeVideo.flv -ab 128 -ar 44100 SomeSong.mp3

It comes out mono instead of stereo, but it’s still your own files on your own computer.

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

One Response to Grab That Online Video: Mozilla

  1. Pingback: Grab That Online Video: Mozilla « Do What's Right | Firefox Blog

Comments are closed.