Skip to content
Advertisement

Running youtube-dl with php exec

I am trying to fetch video details as JSON using PHP exec()
I have youtube-dl installed on my CentOS server.
Running youtube-dl -J <VideoURL> via SSH/Terminal just works fine.
My test.php script returns empty page ๐Ÿ™

JavaScript

exec is enabled if I test it like:

JavaScript

IP of server is not blocked by YouTube as i am able to successfully run command via terminal

Advertisement

Answer

I was able to achieve what you are by doing the following in my test.php file

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement