Created
June 13, 2018 04:24
-
-
Save cooliscool/2b0e0e0292a33af1f928f61ae88e5d3c to your computer and use it in GitHub Desktop.
Youtube Downloader API in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Author : Mohammed Ajmal | |
// github.com/cooliscool | |
// GNU Public License | |
<?php | |
if(isset($_GET['v'])){ | |
// $download = exec('youtube-dl '.$_GET['v']); | |
$comm = 'youtube-dl '.$_GET['v'].' 2>&1'; | |
while (@ ob_end_flush()); | |
$proc = popen($comm, 'r'); | |
echo "<pre>"; | |
while(!feof($proc)){ | |
echo fread($proc,4096); | |
@ flush(); | |
} | |
echo "</pre> "; | |
} | |
else{ | |
$output= shell_exec('ls'); | |
echo "<pre> $output </pre> "; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment