mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
Update
This commit is contained in:
parent
d15a0ec71d
commit
10e272376d
2 changed files with 13 additions and 3 deletions
|
@ -198,9 +198,9 @@ $isActive = $secondsAgo < 10;
|
||||||
|
|
||||||
if (!empty($codeToExec->log)) {
|
if (!empty($codeToExec->log)) {
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'error' => file_exists($logFile),
|
'error' => !file_exists($logFile),
|
||||||
'msg' => '',
|
'msg' => '',
|
||||||
'content' => @file_get_contents($logFile),
|
'logFile' => $logFile,
|
||||||
'time' =>$time,
|
'time' =>$time,
|
||||||
'modified' =>$modified,
|
'modified' =>$modified,
|
||||||
'secondsAgo' =>$secondsAgo,
|
'secondsAgo' =>$secondsAgo,
|
||||||
|
|
|
@ -81,14 +81,24 @@ if (!empty($_REQUEST['tokenForAction'])) {
|
||||||
error_log("Restreamer.json.php token verified " . json_encode($json));
|
error_log("Restreamer.json.php token verified " . json_encode($json));
|
||||||
switch ($json->action) {
|
switch ($json->action) {
|
||||||
case 'log':
|
case 'log':
|
||||||
|
|
||||||
$obj->logName = str_replace($logFileLocation, '', $json->logFile);
|
$obj->logName = str_replace($logFileLocation, '', $json->logFile);
|
||||||
$obj->logName = preg_replace('/[^a-z0-9_.-]/i', '', $obj->logName);
|
$obj->logName = preg_replace('/[^a-z0-9_.-]/i', '', $obj->logName);
|
||||||
if (!empty($obj->logName)) {
|
|
||||||
|
$keyword ='restream_'. md5($json->logFile);
|
||||||
|
$resp = getFFMPEGRemoteLog($keyword);
|
||||||
|
if(!empty($resp)){
|
||||||
|
$obj->modified = $resp->modified;
|
||||||
|
$obj->secondsAgo = $resp->secondsAgo;
|
||||||
|
$obj->isActive = $resp->isActive;
|
||||||
|
$obj->remoteLog = true;
|
||||||
|
}else if (!empty($obj->logName)) {
|
||||||
$logFile = $logFileLocation . $obj->logName;
|
$logFile = $logFileLocation . $obj->logName;
|
||||||
if (file_exists($logFile)) {
|
if (file_exists($logFile)) {
|
||||||
$obj->modified = @filemtime($logFile);
|
$obj->modified = @filemtime($logFile);
|
||||||
$obj->secondsAgo = $obj->time - $obj->modified;
|
$obj->secondsAgo = $obj->time - $obj->modified;
|
||||||
$obj->isActive = $obj->secondsAgo < 10;
|
$obj->isActive = $obj->secondsAgo < 10;
|
||||||
|
$obj->remoteLog = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue