You can use web scraping and extract the information needed to download the video. It only requires about 5 lines of code.
If the YouTube URL is:
http://www.youtube.com/watch?v=DYW50F42ss8
the HTML for the URL may look like the following near "t":
"rv.5.view_count": "470136", "t": "vjVQa1PpcFPDxa83Hr1_9pftRUWdsMyJ10a2o8QZvIs%3D", "rv.6.id": "3f72CTDe4-0"
A regular expression that matches uniquely if the HTML is processed line by line is:
\",\s*\"t\":\s*\"([^\"]+)
The download URL is then
http://www.youtube.com/get_video.php?video_id=ID1&t=ID2
where ID1 is the ID from the input, DYW50F42ss8
in the example. ID2 is what comes after "t"
with %3D
replaced by "=", vjVQa1PpcFPDxa83Hr1_9pftRUWdsMyJ10a2o8QZvIs=
in the example.
Thus the URL to download the Flash video in this example is:
http://www.youtube.com/get_video.php?video_id=DYW50F42ss8&t=vjVQa1PpcFPDxa83Hr1_9pftRUWdsMyJ10a2o8QZvIs=
Note that the structure/syntax of the YouTube HTML changes from time to time and thus your software must also be modified when it happens. I have observed such a change 3 times in 13 months (2008-10, 2009-03 and 2009-08).