Methods for Downloading Google Video as FLV, AVI, or MP4
Alright, the first thing that we need to admit is that we’re standing on the shoulders of electronic giants — downloading Google Video is nothing new. In fact, the means to do it are plentiful. Good people, all over the world, have been hard at work, creating various ways of accessing and downloading video content. Here are but a few:
How do these tools do it? How do you extract at the non-Flash file from a Google Video page? Curious? Read on…
If you’ve used Google Video before, you’ve noticed that most pages have the option to download the video as either a GVP (to be used in Google’s Video Player) or MP4 file (for viewing on an iPod or Sony PSP). Typically, there is a "Download" button located to the right of the video; sometimes there is not. Retrieving an MP4 file is easy — just click the link — no hack needed here.
But what about AVI files? Google doesn’t post that information….do they? Sure they do. Take notice of the other download option that Google provides, a GVP file. What is a GVP file? Download one and open it in your favorite text editor (the example is from "Monkey teases Dog"…..oh those silly monkeys). Examine the GVP file, and you’ll see that it is nothing more than a proprietary header file containing information about the video. Now, take a closer look at the "url" embedded inside the file — it’s not the same URL that you used to view the video or to download "MonkeyteasesDog.gvp". Copy/paste it in your browser — it’s the direct link to the AVI file. Neat! Now you can create your own extractor tool. All you need is a way to parse out the GVP link, a means of finding the URL inside the file, and and some redirect code. It’s easy, and fun for the kids too…
Ever wonder how they name a GVP file? The file names follow a standard format. They are a truncated, 20-character (or less) representation of the video title, with offending characters and whitespaces stripped from the string. The links to the GVP files are created by linking to the GVP file name, then the docid is then tacked to the query string, and voila!, you’ve got your URL.
Don’t leave yet! There’s still another method to get at these sacred files, one which is less know but easier and more bountiful….RSS.
Simply put, you can query Google for RSS, and extract all three URLs from the feed (FLV, MP4, and AVI).
How do you get an RSS feed from Google? Add "&output=rss" to the end of a search URL. For example, if we do a search for monkey videos, it looks like this:
RSS-ize it, we get the following:
Viewing the RSS feed, you immediately recognize standard element tags (i.e. title, description, etc). Look down a little further and you’ll notice that Google also utilizes the media:group and media:content sub-elements. While the number of media:content elements in a given item will vary, most will contain at least one with a type attribute of "video/x-flv". In many cases, we’re provided with more — either a "video/x-msvideo" or "video/mp4". And those, my friends, are the goods. The urls associated with those media:content elements are the direct links to download the AVI and MP4 files.
Given the ease of retrieving and parsing RSS files, you can imagine how simple it would be to create a Google Video search and download tool of your own. I made one: a simple XHMTL search tool for mobile phones:
Enjoy, and best of luck in creating your own tools.