This person has giving a good stuff for downloading from youtube. (www.sajithmr.me/download-youtube-videos-using-php-code) check this out.
If you have your own VPS or dedicated server or can find a server where you can get software "youtubedl" installed. Once said software ins installed the php script is puny: <?php $output = `/usr/bin/youtubedl "https://www.youtube.com/watch?v=FGeIYkjpqI0"`; print $output; PHP: Let me know if you need further details. NOTE: if you want to try it on windows , find youtubedl win32 binary copy youtubedl.exe to folder where your php script is and modify above code to: <?php $output = `youtubedl.exe "https://www.youtube.com/watch?v=FGeIYkjpqI0"`; print $output; PHP: I hope i helps. Stay well.....