My thoughts on Slackware, life and everything

Youtube HD mp4 download

*** 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

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): . 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:


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


  1. Christophe

    Works great!!!

    Thank you.

  2. Larr

    Yes, this works great.


  3. Jeff

    I think youtube has fixed it and this one no longer works anymore…
    Can you help again?

    • alienbob

      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.


  4. Jeff

    Thanks for noticing my comment!
    I’ve tried the new one that you”ve posted, but it doesnt seem to work……

  5. Jeff

    I’m using IE8, does it bother?

  6. Stinger

    Does this work on IE 8.

  7. excellentuk

    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.

  8. alienbob

    Note that this code no longer works.
    In firefox I use this extension now: which is based on this cross-browser script:


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2024 Alien Pastures

Theme by Anders NorenUp ↑