This is an old thing I wrote in php that I had on my Hostgator hosted b9mx.com (a GoDaddy domain which now just redirects to my Freehand MX art blog, the new(ish) WordPress with all my art posts converted from the old Tumblr blog of the same name).
Youtube seems to have changed a lot so I can only get this to work half the time. I’m too lazy to fix it. For functionality purposes, web apps don’t do the best job of scraping the html for MP4 links with economy hosting resources; it works but by the time you download two of them, the third+ MP4 links have already expired because Youtube only provides a temporary MP4 link with each view. It’s the same MP4 provided to you with the HTML5 video player that automatically starts downloading anyway as soon as you view a Youtube video link, that is if the HTML5 player uses MP4 selected by your browser’s preferred video mime type.
I’m only putting this old web app up for historical purposes. I wrote a thing, I’m proud of it, and you can also view its source and see how it used to work on a 2014-2015 Youtube. 2017+ not so much…
The one part of this app that still works perfectly (I think) is the playlist grabber that simply does preg_match on all the video links in any playlist/channel HTML with curl. So you can get a quick list of video links to watch later and online I might add, instead of downloaded to be watched offline like a caveman, because it is 2017 and Youtube online quality is better than ever.