1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 10:49:36 +02:00
This commit is contained in:
Daniel Neto 2024-12-03 10:40:47 -03:00
parent 3781bb7a05
commit 80dbf3d58f
5 changed files with 283 additions and 50 deletions

View file

@ -482,6 +482,23 @@ function execAsync($command, $keyword = null)
return $pid;
}
function execFFMPEGAsyncOrRemote($command, $keyword = null)
{
$obj = AVideoPlugin::getDataObjectIfEnabled('API');
if(!empty($obj) && !empty($obj->standAloneFFMPEG)){
$url = "{$obj->standAloneFFMPEG}";
$url = addQueryStringParameter($url, 'APISecret', $obj->APISecret);
$url = addQueryStringParameter($url, 'ffmpegCommand', $command);
$url = addQueryStringParameter($url, 'keyword', $keyword);
_error_log("execFFMPEGAsyncOrRemote: URL $command");
_error_log("execFFMPEGAsyncOrRemote: URL $url");
return url_get_contents($url);
}else{
_error_log("execFFMPEGAsyncOrRemote: Async $command");
return execAsync($command, $keyword);
}
}
// Function to find the process by keyword using the pid file
function findProcess($keyword)