Contribute to the Lynx browser to download embedded video's to mp4. Add flags to the command line to download them.
Then it serves as an integral part of a web-browser and you don't break the Youtube TOS.
Edit: Add to firefox a right-click option "Save Video As".
Then the community can be like Popcorn time and say, ahem, no copyright infringing code here.
Or a version could even be released w/out the test cases and or README files that make any reference to any type of "illegal" activities.