1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00
This commit is contained in:
daniel 2019-11-29 14:32:45 -03:00
parent 68e02d5d7e
commit 08a97ae738

View file

@ -144,12 +144,16 @@ class API extends PluginAbstract {
require_once $global['systemRootPath'] . 'objects/video.php';
$obj = $this->startResponseObject($parameters);
$dataObj = $this->getDataObject();
if ($dataObj->APISecret === @$_GET['APISecret']) {
if (!empty($parameters['videos_id'])) {
$status = "viewable";
if ($dataObj->APISecret === @$_GET['APISecret']) {
$status = "";
}
$rows = array(Video::getVideo($parameters['videos_id'], $status));
$totalRows = empty($rows) ? 0 : 1;
} else if ($dataObj->APISecret === @$_GET['APISecret']) {
$rows = Video::getAllVideos("viewable", false, true);
$totalRows = Video::getTotalVideos("viewable", false, true);
} else if (!empty($parameters['videos_id'])) {
$rows = array(Video::getVideo($parameters['videos_id']));
$totalRows = empty($rows) ? 0 : 1;
} else if (!empty($parameters['clean_title'])) {
$rows = Video::getVideoFromCleanTitle($parameters['clean_title']);
$totalRows = empty($rows) ? 0 : 1;