-2

i can run youtube-dl.php from command line "php youtube-dl.php" works fine

but not working from http... is it someting with chown?

$url = "https://www.youtube.com/watch?v=KdS6HFQ_LUc";

echo "Saving $url";


$cmd = 'youtube-dl -o "/var/www/domain.com/test/%(title)s.%(ext)s" '.$url.' -f bestvideo+bestaudio'; 
exec($cmd, $output, $ret);
echo 'output: ';
var_export($output);

echo "\nret: "; var_export($ret);

2 Answers2

0

There is no need to run any scripts in the first place. Simply add -f bestvideo+bestaudio/best to your youtube-dl command-line and let youtube-dl merge the video automatically. Don't forget to install ffmpeg!

0

For downloading video in format of your choice type in following :

youtube-dl -F  {video URL}

When you type in the command for downloading video with format or your choice it'll give you list of different options, showing the formats and resolutions of that video. choose the code of one you like and type in following:

youtube-dl -f  {format code} {video URL}
serenesat
  • 4,611
  • 10
  • 37
  • 53