20090902 download most youtube videos - plembo/onemoretech GitHub Wiki

title: download (most) youtube videos link: https://onemoretech.wordpress.com/2009/09/02/download-most-youtube-videos/ author: lembobro description: post_id: 259 created: 2009/09/02 03:37:10 created_gmt: 2009/09/02 03:37:10 comment_status: open post_name: download-most-youtube-videos status: publish post_type: post

download (most) youtube videos

Note: On or about October 22, 2009, YouTube changed their code and broke the original version of this trick — something I’m sure had nothing to do with my publishing it. There’s absolutely no evidence that engineers from either YouTube or its parent, Google, read this blog.

This little note is about how to use a Firefox bookmarklet to download YouTube videos as standard .mp4 files.

The procedure described here is discussed in more detail in two posts on the Google Operating System blog. The first, Share Almost Any Blog Post in Google Reader, presents the basic concept of how to create a JavaScript payload on your bookmarks toolbar to automate rewriting a url. The second, Download YouTube Videos as MP4 Files, applies this method to retrieve video content as an .mp4 format. The article includes a button that can be literally dragged onto your Firefox bookmarks toolbar to create the bookmarklet, like this:

Get YouTube video

Doing this without that magic button just requires you to right click on your Firefox bookmarks toolbar and select “New Bookmark”. Then fill in the fields as shown in the screenshot below.

[caption id=”attachment_2405” align=”aligncenter” width=”300” caption=”Making a YouTube downloading bookmarklet”]Making a YouTube downloading bookmarklet[/caption]

The bit of JavaScript that’s at the heart of this process can be grabbed from the above link, or downloaded here.

What the script in fact does is rewrite the video’s YouTube url so and then has the browser retrieve an .mp4 formatted version of the content. By looking closely at the code you can see how the author used a regular expression (regex) match and replace to get the job done. The “get_video” control causes the app server to deliver up the content in the desired format.

Of course this trick will only work until YouTube or its Google parent decide to change how content is delivered. If (er, when) they do that, this solution will break. But until then, this is another useful instrument in the toolbox.

Copyright 2004-2019 Phil Lembo