*** This post was updated with new JavaScript code on 27-oct-2009 ***
Sure, you can install Video Downloadhelper for Firefox if you want an easy way to download your favourite YouTube videos.
However, these will be downloaded in “FLV” format (Flash video). Nowadays, many videos on YouTube are available in High-Definition (HD) format and you may want to retrieve the higher quality (MP4) movies instead.
Here is a bit of JavaScript which checks if the movie you selected is available as HD 720p. If a HD format is available it will be the preferred download type (fmt24) instead of the usual “high” (fmt18) or
“regular”quality.
I got the javascript code from this page, which I found after my original javascript code stopped working (I guess Google removed the javascript functions to block folks like us): http://googlesystem.blogspot.com/2008/04/download-youtube-videos-as-mp4-files.html . The new code is a lot uglier than the initial javascript, but it works. That page also has the same code available, nicely reformatted, as a GreaseMonkey script if you have that firefox extension already installed.
Define the following text as a bookmark and you are only a click away from downloading HD YouTube videos (in Firefox, right-click the link below and select “bookmark this link“):
Note: this was the old code which now will no longer work:
javascript:if(document.location.href.match(/http:\/\/[a-zA-Z\.]*youtube\.com\/watch/)){document.location.href=’http://www.youtube.com/get_video?fmt=’+(isHDAvailable?’22’:’18’)+’&video_id=’+swfArgs[‘video_id’]+’&t=’+swfArgs[‘t’]}
The proof of the pudding is in the eating. Select a YouTube video, click on “pause” if you do not want to play it in the embedded video frame. Then, click on the bookmark you created and the video will start downloading. It will (always) be saved with the name “video.mp4” so you will have to rename it after the download finishes.
Have fun! Eric
Works great!!!
Thank you.
Yes, this works great.
Thanks!!!
I think youtube has fixed it and this one no longer works anymore…
Can you help again?
Hm indeed, Google is blocking the javascript that used to work. It needs a lot more fiddling now, but luckily someone figured it out. I’ll update the main post with the new code.
Eric
Thanks for noticing my comment!
I’ve tried the new one that you”ve posted, but it doesnt seem to work……
I’m using IE8, does it bother?
Does this work on IE 8.
nice tool.
but i am using Brorsoft YouTube Converter which can help me to free download youtube videos and also help me to convert youtube videos to other formats i need,eg convert to mp4 to put on my iphone.
Note that this code no longer works.
In firefox I use this extension now: https://addons.mozilla.org/nl/firefox/addon/download-youtube/ which is based on this cross-browser script: http://userscripts.org/scripts/show/25105
Eric