This would be cool, but is there a benefit to downloading the videos from youtube? why not just stream them? then the load is on youtube and not your server. Either way would be cool though.
I wish I had the know how to help code, but I have done a lot of digging in the past looking for ways to use youtubes API to grab videos tagged with certain keywords. Its been hit or miss but some of these scripts may help us get something working here.
Check out PHP Director
In this script, users add a link to a youtube video, and the video is displayed and plays locally, but streams from youtube.
Site: http://www.phpdirector.co.uk/site/Demo: http://www.phpdirector.co.uk/demo/There are several other YouTube API scripts as well.
PHP TubeWax JellyYoutube Catalog Maybe these scripts can give us some insight, or maybe an integration with one of them would work.