Make the Easiest Trick to Download YouTube Video Using JavaScript
Just a Small Piece of JavaScript to Trick YouTube Video Download
Okay, so this simple tutorial is going to show you how to make such a JavaScript segment to trick YouTube.
To start off, lets see the basic JavaScript code for normal YouTube videos:
javascript:window.location.href = 'http://youtube.com/get_video?video_id=' + swfArgs['video_id'] + "&l=" + swfArgs['l'] + "&sk=" + swfArgs['sk'] + '&t=' + swfArgs['t'];
The main syntax "window.location.href" of this JavaScript, is the beginner's client-side object "location" with its property "href" to access the "location" property of the "window" object. The result of this behavior is opening a window in specified URL upon current page.
Client-Side JavaScript Reference: http://docs.sun.com/source/816-6408-10/location.htm
The parameter part of "http://youtube.com/get_video?" is the syntax of requesting the video from YouTube's depository server.
We know, those major arguments of requesting specified video on server, such as "video_id", "l", "sk" and "t", are written as ActionScript inside YouTube's Flash player. So we can retrieve the arguments out of the Flash object, by the same parameter "swfArgs['*']". And all parameters after the question mark are clear: video_id=' + swfArgs['video_id'] + "&l=" + swfArgs['l'] + "&sk=" + swfArgs['sk'] + '&t=' + swfArgs['t']
Now just type or paste the exact client-side JavaScript in the address bar of the browser and enter to go, after the YouTube video page is completely loaded. A new window will prompt to ask you to download a file called "video.flv", that's the YouTube video file requested.
And the derivatives of this JavaScript trick are for the latest YouTube HQ (High Quality) and HD (High Definition) videos. The only thing we should know is the new argument. It's "fmt" to differentiate among normal quality, HQ quality and HD quality if available. And the "fmt" value for HQ is "18", as HD is "22". Then we can add the argument with specified value to retrieve different files from the server.
JavaScript for HQ (High Quality) YouTube video if it is available:
javascript:window.location.href = 'http://youtube.com/get_video?video_id=' + swfArgs['video_id'] + "&fmt=18" + "&l=" + swfArgs['l'] + "&sk=" + swfArgs['sk'] + '&t=' + swfArgs['t'];
JavaScript for HD (High Definition) YouTube video if it is available:
javascript:window.location.href = 'http://youtube.com/get_video?video_id=' + swfArgs['video_id'] + "&fmt=22" + "&l=" + swfArgs['l'] + "&sk=" + swfArgs['sk'] + '&t=' + swfArgs['t'];
Again just type or paste the script in address bar and go.
Someone asks, this trick is so easy to learn and try, but why some YouTube video download tools still survive? Because this trick is only for YouTube, the world's largest video sharing center, and other video sharing sites need different tricks to go. Certainly you can make another easiest JavaScript trick for them. However, most common users will like such a full-featured program like Video Downloader to work with most other video sites, and even convert videos for iPod or DVD ready.
Well, that's the tutorial, hopefully now you're able to make your own way to enjoy. You'll like JavaScript more than ever. And this trick works as long as you want until YouTube changes its own algorithm. No software, no third party sites, only a small piece of JavaScript when you're browsing YouTube, the magic is definitely the world's easiest YouTube video trick, isn't it?
Published by Jason Gabrilla
How to: Download YouTube Videos Using MiroIf you've seen a good YouTube video and you would like to download it, this how to is the one you need! Start downloading all of your favorite YouTube videos so you can play the...- How to Download Youtube VideosA how-to guide to downloading Youtube videos in order to watch them via your desktop or move them elsewhere.
- Download YouTube Videos to Your Computer or MP4 PlayerHave you ever seen a video on YouTube and wanted to put it onto your computer or MP4 player, well you would be pleased to know that there are plenty of services out there that will do that for you.
- Youtube.com: A New Independent Independent CinemaThe creation of Internet video forums like YouTube.com over the past two years has arguably redefined what has come to be accepted as the "independent film" genre.
YouTube; Evolution of Dance Back on Top of Most ViewedThe most viewed top spot on YouTube is the holy grail of YouTube-dom. Recently the owner of the grail was overtaken causing quite a stir on YouTube.
- Download Youtube Video Converter for YouTube Videos
- How to Download YouTube Videos for an IPod or IPhone
- How to Download YouTube Videos with WM Recorder or Real Player
- Tips on How to Download YouTube Videos as MP4 Files
- Free YouTube Video Download - Tutorial
- MacTubes - Download YouTube Videos to Your Mac
- Download YouTube Videos with QtTube



