Downloading video from YouTube
You can check out libvideo. It's much more up-to-date than YoutubeExtractor, and is fast and clean to use.
Gonna give another answer, since the libraries mentioned haven't been actively developed anymore.
Consider using YoutubeExplode. It has a very rich and consistent API and allows you to do a lot of other things with youtube videos beside downloading them.
I've written a library that is up-to-date, since all the other answers are outdated:
https://github.com/flagbug/YoutubeExtractor