When you hit download, the page sends an AJAX request to a server-side php file, along with the URL you entered. This URL is passed on to a shell script that runs server side to cache the video using the <code>youtube-dl</code> program.<br>
After it's cached, the URL is passed back to client for you to download. The file remains cached until midnight, when a cronjob clears the cache folder.<br>
If you want to delve into the code yourself, the source code is available on GitHub <ahref="https://github.com/98WuG/youtube-dl-web">here</a>. Or, you can close this box and click the GitHub triangle in the upper right-hand corner.
I wanted an internet-connected, self-hosted YouTube downloading service. While I could use vanilla <code>youtube-dl</code>, I won't always have access to a machine with it installed. And other online YouTube downloading sites are sketchy and ad-ridden, to put it mildly. I can't really trust them. Thus, this project was born.<br>
Also, it was a nice exercise to get myself more familiar with fundamental web development.
Yes, I'm aware you can. Good on you. I can as well. You're not proving anything to yourself or anyone besides being able to ruin a free, open-source web service. Please don't do that. I'm sure you have better things to do with your life.