Closed markizk closed 7 years ago
You need to ask to your hosting provider to enable exec() function in your PHP.ini: http://www.queryadmin.com/1588/enable-disable-exec-php/
Regarding the second warning about foreach(), you can fix it like this:
Edit the file /src/Plugin/YoutubePlugin.php on line 38 and change it as this:
if($formats) foreach($formats as $vid){
Adding if($formats) will remove the warning message.
Thanks @webaddicto
But there are still problems with Videos from VEVO etc. Is it possible to weite a plug in that replace the video and put the embedded video instead.
Thanks
Php-proxy uses youtubedl: https://github.com/rg3/youtube-dl
To get the video URL, see this code from YouTube plugin:
// will return empty if youtube-dl not installed
private function youtube_dl(){
$result = array();
$start = microtime(true);
// --get-url
// --dump-single-json
$cmd = sprintf('youtube-dl -J %s', escapeshellarg($this->youtube_url));
exec($cmd, $output, $ret);
$end = microtime(true);
if($ret == 0){
$json = json_decode($output[0], true);
// formats
$formats = $json['formats'];
foreach($formats as $vid){
$result[$vid['format_id']] = $vid['url'];
}
}
return $result;
}
So you must have youtubedl installed in your server: http://rg3.github.io/youtube-dl/download.html
You're using an outdated version of php-proxy. Latest version no longer defaults to youtube-dl for Vevo videos and such.
Is this also possible with the last version of php-proxy-app, because if i visit the vevo videos ther it´s not possible to play. (https://www.youtube.com/watch?v=CevxZvSJLk8&list=PLWRJVI4Oj4IaYIWIpFlnRJ_v_fIaIl6Ey) would not play.
How do you know that you're using the latest version? This API script uses the latest version and your katty perry video loads fine here: https://api.unblockvideos.com/youtube_downloader?id=CevxZvSJLk8&selector=mp4&redirect=true
you need to manually edit your composer.json file and ask for "dev-master" version instead of 1.0 or 1.1 whatever.
When I call a YT Site i get this error
How can I repair this ?