1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Add support for YPT Storage

This commit is contained in:
daniel 2019-07-24 14:01:23 -03:00
parent 1cd325e608
commit 7dcc3bfa9f
9 changed files with 280 additions and 107 deletions

1
.gitignore vendored
View file

@ -52,3 +52,4 @@
/plugin/User_Controll/ /plugin/User_Controll/
/plugin/FlixHouse/ /plugin/FlixHouse/
/plugin/Video_Location_Block/ /plugin/Video_Location_Block/
/plugin/YPTStorage/

View file

@ -1,6 +1,6 @@
<?php <?php
$installationVersion = "7.2"; $installationVersion = "7.3";
header('Content-Type: application/json'); header('Content-Type: application/json');

View file

@ -82,6 +82,16 @@ CREATE TABLE IF NOT EXISTS `categories` (
ON UPDATE CASCADE) ON UPDATE CASCADE)
ENGINE = InnoDB; ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `sites` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NULL DEFAULT NULL,
`url` VARCHAR(255) NOT NULL,
`created` DATETIME NULL DEFAULT NULL,
`modified` DATETIME NULL DEFAULT NULL,
`status` CHAR(1) NULL DEFAULT NULL,
`secret` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
-- ----------------------------------------------------- -- -----------------------------------------------------
-- Table `videos` -- Table `videos`
@ -121,12 +131,19 @@ CREATE TABLE IF NOT EXISTS `videos` (
`rrating` VARCHAR(45) NULL DEFAULT NULL, `rrating` VARCHAR(45) NULL DEFAULT NULL,
`externalOptions` TEXT NULL DEFAULT NULL, `externalOptions` TEXT NULL DEFAULT NULL,
`only_for_paid` TINYINT(1) NULL DEFAULT NULL, `only_for_paid` TINYINT(1) NULL DEFAULT NULL,
`sites_id` INT(11) NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
INDEX `fk_videos_users_idx` (`users_id` ASC), INDEX `fk_videos_users_idx` (`users_id` ASC),
INDEX `fk_videos_categories1_idx` (`categories_id` ASC), INDEX `fk_videos_categories1_idx` (`categories_id` ASC),
UNIQUE INDEX `clean_title_UNIQUE` (`clean_title` ASC), UNIQUE INDEX `clean_title_UNIQUE` (`clean_title` ASC),
INDEX `index5` (`order` ASC), INDEX `index5` (`order` ASC),
INDEX `fk_videos_videos1_idx` (`next_videos_id` ASC), INDEX `fk_videos_videos1_idx` (`next_videos_id` ASC),
INDEX `fk_videos_sites1_idx` (`sites_id` ASC),
CONSTRAINT `fk_videos_sites1`
FOREIGN KEY (`sites_id`)
REFERENCES `sites` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_videos_users` CONSTRAINT `fk_videos_users`
FOREIGN KEY (`users_id`) FOREIGN KEY (`users_id`)
REFERENCES `users` (`id`) REFERENCES `users` (`id`)

View file

@ -7,40 +7,47 @@ if (!isCommandLineInterface()) {
return die('Command Line only'); return die('Command Line only');
} }
$fileExtensions = array('jpg', 'mp4', 'webm'); $fileExtensions = array('jpg', 'gif', 'mp4', 'webm');
$files = array(); $files = array();
foreach (glob("../videos/*.{" . implode(",", $fileExtensions) . "}", GLOB_BRACE) as $filename) { //foreach (glob("../videos/*.{" . implode(",", $fileExtensions) . "}", GLOB_BRACE) as $filename) {
foreach (glob("../videos/*", GLOB_BRACE) as $filename) {
$base = basename($filename); $base = basename($filename);
if (is_dir($filename)) {
$baseName = explode("_portrait", $base); if (strpos($base, "_YPTuniqid_") !== false) {
if (!empty($baseName[1])) { $files[$base] = array($base, $filename);
$files[$base] = array($baseName[0], $filename); }
} else { } else {
$baseName = explode("_thumbs", $base);
$baseName = explode("_portrait", $base);
if (!empty($baseName[1])) { if (!empty($baseName[1])) {
$files[$base] = array($baseName[0], $filename); $files[$base] = array($baseName[0], $filename);
} else { } else {
$types = array('_HD', '_Low', '_SD'); $baseName = explode("_thumbs", $base);
$notFound = true; if (!empty($baseName[1])) {
foreach ($types as $value) { $files[$base] = array($baseName[0], $filename);
$baseName = explode($value, $base); } else {
if (!empty($baseName[1])) { $types = array('_HD', '_Low', '_SD');
$files[$base] = array($baseName[0], $filename); $notFound = true;
$notFound = false; foreach ($types as $value) {
} $baseName = explode($value, $base);
}
if ($notFound) {
foreach ($fileExtensions as $value) {
if (strpos($base, ".$value") === false) {
continue;
}
$baseName = str_replace("." . $value, "", $base);
if (!empty($baseName[1])) { if (!empty($baseName[1])) {
if (!in_array($baseName, $files)) { $files[$base] = array($baseName[0], $filename);
$files[$base] = array($baseName, $filename); $notFound = false;
}
}
if ($notFound) {
foreach ($fileExtensions as $value) {
if (strpos($base, ".$value") === false) {
continue;
}
$baseName = str_replace("." . $value, "", $base);
if (!empty($baseName[1])) {
if (!in_array($baseName, $files)) {
$files[$base] = array($baseName, $filename);
}
} }
} }
} }
@ -60,16 +67,24 @@ $totalSize = 0;
foreach ($files as $key => $value) { foreach ($files as $key => $value) {
$size = filesize($value[1]); $size = filesize($value[1]);
$totalSize += $size; $totalSize += $size;
echo "{$value[0]} => $value[1] ".(humanFileSize($size))." \n"; echo "{$value[0]} => $value[1] " . (humanFileSize($size)) . " \n";
} }
echo "*** Confirm Delete Them (".humanFileSize($totalSize).")? y/n: "; echo "*** Confirm Delete Them (" . humanFileSize($totalSize) . ")? y/n: ";
ob_flush(); ob_flush();
$confirm = trim(readline("")); $confirm = trim(readline(""));
if (!empty($confirm) && strtolower($confirm)==='y') { if (!empty($confirm) && strtolower($confirm) === 'y') {
foreach ($files as $key => $value) { foreach ($files as $key => $value) {
if(unlink($value[1])){ if (is_dir($value[1])) {
rrmdir($value[1]);
if (is_dir($value[1])) {
echo "$value[1] Directory Deleted \n";
} else {
echo "$value[1] Directory Could Not be Deleted \n";
}
} else
if (unlink($value[1])) {
echo "$value[1] Deleted \n"; echo "$value[1] Deleted \n";
}else{ } else {
echo "$value[1] Could Not be Deleted \n"; echo "$value[1] Could Not be Deleted \n";
} }
} }

64
objects/sites.php Normal file
View file

@ -0,0 +1,64 @@
<?php
global $global, $config;
if(!isset($global['systemRootPath'])){
require_once '../videos/configuration.php';
}
class Sites extends ObjectYPT {
protected $name, $url, $status, $secret;
public static function getSearchFieldsNames() {
return array('name', 'url');
}
public static function getTableName() {
return 'sites';
}
function getName() {
return $this->name;
}
function getUrl() {
return $this->url;
}
function getStatus() {
return $this->status;
}
function setName($name) {
$this->name = $name;
}
function setUrl($url) {
$this->url = $url;
}
function setStatus($status) {
$this->status = $status;
}
function getSecret() {
return $this->secret;
}
function setSecret($secret) {
$this->secret = $secret;
}
function save() {
if(empty($this->getSecret())){
$this->setSecret(md5(uniqid()));
}
$siteURL = $this->getUrl();
if (substr($siteURL, -1) !== '/') {
$siteURL .= "/";
}
$this->setUrl($siteURL);
return parent::save();
}
}

View file

@ -10,6 +10,7 @@ require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/category.php'; require_once $global['systemRootPath'] . 'objects/category.php';
require_once $global['systemRootPath'] . 'objects/include_config.php'; require_once $global['systemRootPath'] . 'objects/include_config.php';
require_once $global['systemRootPath'] . 'objects/video_statistic.php'; require_once $global['systemRootPath'] . 'objects/video_statistic.php';
require_once $global['systemRootPath'] . 'objects/sites.php';
if (!class_exists('Video')) { if (!class_exists('Video')) {
class Video { class Video {
@ -43,6 +44,7 @@ if (!class_exists('Video')) {
private $only_for_paid; private $only_for_paid;
private $rrating; private $rrating;
private $externalOptions; private $externalOptions;
private $sites_id;
static $statusDesc = array( static $statusDesc = array(
'a' => 'active', 'a' => 'active',
'i' => 'inactive', 'i' => 'inactive',
@ -140,6 +142,14 @@ if (!class_exists('Video')) {
$this->users_id = $users_id; $this->users_id = $users_id;
} }
function getSites_id() {
return $this->sites_id;
}
function setSites_id($sites_id) {
$this->sites_id = $sites_id;
}
function save($updateVideoGroups = false, $allowOfflineUser = false) { function save($updateVideoGroups = false, $allowOfflineUser = false) {
global $advancedCustom; global $advancedCustom;
if (!User::isLogged() && !$allowOfflineUser) { if (!User::isLogged() && !$allowOfflineUser) {
@ -207,6 +217,11 @@ if (!class_exists('Video')) {
$this->next_videos_id = 'NULL'; $this->next_videos_id = 'NULL';
} }
$this->sites_id = intval($this->sites_id);
if (empty($this->sites_id)) {
$this->sites_id = 'NULL';
}
$this->can_download = intval($this->can_download); $this->can_download = intval($this->can_download);
$this->can_share = intval($this->can_share); $this->can_share = intval($this->can_share);
$this->only_for_paid = intval($this->only_for_paid); $this->only_for_paid = intval($this->only_for_paid);
@ -220,12 +235,12 @@ if (!class_exists('Video')) {
$sql = "UPDATE videos SET title = '{$this->title}',clean_title = '{$this->clean_title}'," $sql = "UPDATE videos SET title = '{$this->title}',clean_title = '{$this->clean_title}',"
. " filename = '{$this->filename}', categories_id = '{$this->categories_id}', status = '{$this->status}'," . " filename = '{$this->filename}', categories_id = '{$this->categories_id}', status = '{$this->status}',"
. " description = '{$this->description}', duration = '{$this->duration}', type = '{$this->type}', videoDownloadedLink = '{$this->videoDownloadedLink}', youtubeId = '{$this->youtubeId}', videoLink = '{$this->videoLink}', next_videos_id = {$this->next_videos_id}, isSuggested = {$this->isSuggested}, users_id = {$this->users_id}, " . " description = '{$this->description}', duration = '{$this->duration}', type = '{$this->type}', videoDownloadedLink = '{$this->videoDownloadedLink}', youtubeId = '{$this->youtubeId}', videoLink = '{$this->videoLink}', next_videos_id = {$this->next_videos_id}, isSuggested = {$this->isSuggested}, users_id = {$this->users_id}, "
. " trailer1 = '{$this->trailer1}', trailer2 = '{$this->trailer2}', trailer3 = '{$this->trailer3}', rate = '{$this->rate}', can_download = '{$this->can_download}', can_share = '{$this->can_share}', only_for_paid = '{$this->only_for_paid}', rrating = '{$this->rrating}', externalOptions = '{$this->externalOptions}' , modified = now()" . " trailer1 = '{$this->trailer1}', trailer2 = '{$this->trailer2}', trailer3 = '{$this->trailer3}', rate = '{$this->rate}', can_download = '{$this->can_download}', can_share = '{$this->can_share}', only_for_paid = '{$this->only_for_paid}', rrating = '{$this->rrating}', externalOptions = '{$this->externalOptions}', sites_id = {$this->sites_id} , modified = now()"
. " WHERE id = {$this->id}"; . " WHERE id = {$this->id}";
} else { } else {
$sql = "INSERT INTO videos " $sql = "INSERT INTO videos "
. "(title,clean_title, filename, users_id, categories_id, status, description, duration,type,videoDownloadedLink, next_videos_id, created, modified, videoLink, can_download, can_share, only_for_paid, rrating, externalOptions) values " . "(title,clean_title, filename, users_id, categories_id, status, description, duration,type,videoDownloadedLink, next_videos_id, created, modified, videoLink, can_download, can_share, only_for_paid, rrating, externalOptions, sites_id) values "
. "('{$this->title}','{$this->clean_title}', '{$this->filename}', {$this->users_id},{$this->categories_id}, '{$this->status}', '{$this->description}', '{$this->duration}', '{$this->type}', '{$this->videoDownloadedLink}', {$this->next_videos_id},now(), now(), '{$this->videoLink}', '{$this->can_download}', '{$this->can_share}','{$this->only_for_paid}', '{$this->rrating}', '$this->externalOptions')"; . "('{$this->title}','{$this->clean_title}', '{$this->filename}', {$this->users_id},{$this->categories_id}, '{$this->status}', '{$this->description}', '{$this->duration}', '{$this->type}', '{$this->videoDownloadedLink}', {$this->next_videos_id},now(), now(), '{$this->videoLink}', '{$this->can_download}', '{$this->can_share}','{$this->only_for_paid}', '{$this->rrating}', '$this->externalOptions', {$this->sites_id})";
} }
$insert_row = sqlDAL::writeSql($sql); $insert_row = sqlDAL::writeSql($sql);
if ($insert_row) { if ($insert_row) {
@ -243,6 +258,7 @@ if (!class_exists('Video')) {
} else { } else {
$id = $this->id; $id = $this->id;
} }
self::deleteTagsAsync($this->id);
if ($updateVideoGroups) { if ($updateVideoGroups) {
require_once $global['systemRootPath'] . 'objects/userGroups.php'; require_once $global['systemRootPath'] . 'objects/userGroups.php';
// update the user groups // update the user groups
@ -545,7 +561,7 @@ if (!class_exists('Video')) {
return " AND " . $sql; return " AND " . $sql;
} }
static function getVideo($id = "", $status = "viewable", $ignoreGroup = false, $random = false, $suggetedOnly = false, $showUnlisted = false) { static function getVideo($id = "", $status = "viewable", $ignoreGroup = false, $random = false, $suggetedOnly = false, $showUnlisted = false, $ignoreTags = false) {
global $global, $config; global $global, $config;
if ($config->currentVersionLowerThen('5')) { if ($config->currentVersionLowerThen('5')) {
return false; return false;
@ -678,14 +694,16 @@ if (!class_exists('Video')) {
$video['title'] = UTF8encode($video['title']); $video['title'] = UTF8encode($video['title']);
$video['description'] = UTF8encode($video['description']); $video['description'] = UTF8encode($video['description']);
$video['progress'] = self::getVideoPogressPercent($video['id']); $video['progress'] = self::getVideoPogressPercent($video['id']);
$video['tags'] = self::getTags($video['id']); if(!$ignoreTags){
$video['tags'] = self::getTags($video['id']);
}
if (!empty($video['externalOptions'])) { if (!empty($video['externalOptions'])) {
$video['externalOptions'] = json_decode($video['externalOptions']); $video['externalOptions'] = json_decode($video['externalOptions']);
} else { } else {
$video['externalOptions'] = new stdClass(); $video['externalOptions'] = new stdClass();
} }
if (YouPHPTubePlugin::isEnabledByName("VideoTags")) { if (!$ignoreTags && YouPHPTubePlugin::isEnabledByName("VideoTags")) {
$video['videoTags'] = Tags::getAllFromVideosId($video['id']); $video['videoTags'] = Tags::getAllFromVideosId($video['id']);
$video['videoTagsObject'] = Tags::getObjectFromVideosId($video['id']); $video['videoTagsObject'] = Tags::getObjectFromVideosId($video['id']);
} }
@ -702,17 +720,15 @@ if (!class_exists('Video')) {
global $global, $config; global $global, $config;
$id = intval($id); $id = intval($id);
$sql = "SELECT * FROM videos WHERE id = '$id' LIMIT 1"; $sql = "SELECT * FROM videos WHERE id = '$id' LIMIT 1";
$res = sqlDAL::readSql($sql); $res = sqlDAL::readSql($sql, "", array(), true);
$video = sqlDAL::fetchAssoc($res); $video = sqlDAL::fetchAssoc($res);
sqlDAL::close($res); sqlDAL::close($res);
return $video; return $video;
} }
static function getVideoFromFileName($fileName, $ignoreGroup = false) { static function getVideoFromFileName($fileName, $ignoreGroup = false, $ignoreTags = false) {
//error_log('Enter getVideoFromFileName ('.$fileName.')');
global $global; global $global;
if (empty($fileName)) { if (empty($fileName)) {
//error_log("getVideoFromFileName ERROR File name is empty ");
return false; return false;
} }
$sql = "SELECT id FROM videos WHERE filename = ? LIMIT 1"; $sql = "SELECT id FROM videos WHERE filename = ? LIMIT 1";
@ -722,11 +738,25 @@ if (!class_exists('Video')) {
$video = sqlDAL::fetchAssoc($res); $video = sqlDAL::fetchAssoc($res);
sqlDAL::close($res); sqlDAL::close($res);
if (!empty($video['id'])) { if (!empty($video['id'])) {
return self::getVideo($video['id'], "", $ignoreGroup, false, false, true); return self::getVideo($video['id'], "", $ignoreGroup, false, false, true, $ignoreTags);
} }
//$video['groups'] = UserGroups::getVideoGroups($video['id']);
} }
//error_log(" Not Found getVideoFromFileName({$fileName}) "); return false;
}
static function getVideoFromFileNameLight($fileName) {
global $global;
if (empty($fileName)) {
return false;
}
$sql = "SELECT * FROM videos WHERE filename = ? LIMIT 1";
$res = sqlDAL::readSql($sql, "s", array($fileName));
if ($res != false) {
$video = sqlDAL::fetchAssoc($res);
sqlDAL::close($res);
return $video;
}
return false; return false;
} }
@ -1225,7 +1255,7 @@ if (!class_exists('Video')) {
if (!empty($this->id)) { if (!empty($this->id)) {
$this->removeNextVideos($this->id); $this->removeNextVideos($this->id);
$this->removeTrailerReference($this->id); $this->removeTrailerReference($this->id);
$video = self::getVideo($this->id); $video = self::getVideoLight($this->id);
$sql = "DELETE FROM videos WHERE id = ?"; $sql = "DELETE FROM videos WHERE id = ?";
} else { } else {
return false; return false;
@ -1237,6 +1267,7 @@ if (!class_exists('Video')) {
$aws_s3 = YouPHPTubePlugin::loadPluginIfEnabled('AWS_S3'); $aws_s3 = YouPHPTubePlugin::loadPluginIfEnabled('AWS_S3');
$bb_b2 = YouPHPTubePlugin::loadPluginIfEnabled('Blackblaze_B2'); $bb_b2 = YouPHPTubePlugin::loadPluginIfEnabled('Blackblaze_B2');
$ftp = YouPHPTubePlugin::loadPluginIfEnabled('FTP_Storage'); $ftp = YouPHPTubePlugin::loadPluginIfEnabled('FTP_Storage');
$YPTStorage = YouPHPTubePlugin::loadPluginIfEnabled('YPTStorage');
if (!empty($aws_s3)) { if (!empty($aws_s3)) {
$aws_s3->removeFiles($video['filename']); $aws_s3->removeFiles($video['filename']);
} }
@ -1246,6 +1277,9 @@ if (!class_exists('Video')) {
if (!empty($ftp)) { if (!empty($ftp)) {
$ftp->removeFiles($video['filename']); $ftp->removeFiles($video['filename']);
} }
if (!empty($YPTStorage)) {
$YPTStorage->removeFiles($video['filename'], $video['sites_id']);
}
$this->removeFiles($video['filename']); $this->removeFiles($video['filename']);
self::deleteThumbs($video['filename']); self::deleteThumbs($video['filename']);
} }
@ -1705,10 +1739,14 @@ if (!class_exists('Video')) {
} }
static function deleteTagsAsync($video_id) { static function deleteTagsAsync($video_id) {
global $global;
if (empty($video_id)) { if (empty($video_id)) {
return false; return false;
} }
global $global, $advancedCustom; if (session_status() == PHP_SESSION_NONE) {
session_start();
}
unset($_SESSION['getVideoTags'][$video_id]);
$path = $global['systemRootPath'] . "videos/cache/getTagsAsync/"; $path = $global['systemRootPath'] . "videos/cache/getTagsAsync/";
if(!is_dir($path)){ if(!is_dir($path)){
return false; return false;
@ -2087,10 +2125,17 @@ if (!class_exists('Video')) {
if ($type == ".m3u8") { if ($type == ".m3u8") {
$source['path'] = "{$global['systemRootPath']}videos/{$filename}/index{$type}"; $source['path'] = "{$global['systemRootPath']}videos/{$filename}/index{$type}";
} }
$video = Video::getVideoFromFileName(str_replace(array('_Low', '_SD', '_HD'), array('', '', ''), $filename)); $video = Video::getVideoFromFileNameLight(str_replace(array('_Low', '_SD', '_HD'), array('', '', ''), $filename));
$canUseCDN = canUseCDN($video['id']); $canUseCDN = canUseCDN($video['id']);
//error_log(json_encode(array('$filename'=>$filename, '$advancedCustom->videosCDN'=>$advancedCustom->videosCDN,'canUseCDN($video[id])'=>canUseCDN($video['id']),'$video[id]'=>$video['id'])));
if (!empty($advancedCustom->videosCDN) && $canUseCDN) { if (!empty($video['sites_id']) && ($type == ".mp3" || $type == ".mp4" || $type == ".webm" || $type == ".m3u8")) {
$site = new Sites($video['sites_id']);
$siteURL = rtrim($site->getUrl(), '/') . '/';
$source['url'] = "{$siteURL}videos/{$filename}{$type}{$token}";
if ($type == ".m3u8") {
$source['url'] = "{$siteURL}videos/{$filename}/index{$type}{$token}";
}
} else if (!empty($advancedCustom->videosCDN) && $canUseCDN) {
$advancedCustom->videosCDN = rtrim($advancedCustom->videosCDN, '/') . '/'; $advancedCustom->videosCDN = rtrim($advancedCustom->videosCDN, '/') . '/';
$source['url'] = "{$advancedCustom->videosCDN}videos/{$filename}{$type}{$token}"; $source['url'] = "{$advancedCustom->videosCDN}videos/{$filename}{$type}{$token}";
if ($type == ".m3u8") { if ($type == ".m3u8") {

View file

@ -0,0 +1,31 @@
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
CREATE TABLE IF NOT EXISTS `sites` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NULL DEFAULT NULL,
`url` VARCHAR(255) NOT NULL,
`created` DATETIME NULL DEFAULT NULL,
`modified` DATETIME NULL DEFAULT NULL,
`status` CHAR(1) NULL DEFAULT NULL,
`secret` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
ALTER TABLE `videos`
ADD COLUMN `sites_id` INT(11) NULL,
ADD INDEX `fk_videos_sites1_idx` (`sites_id` ASC);
ALTER TABLE `videos`
ADD CONSTRAINT `fk_videos_sites1`
FOREIGN KEY (`sites_id`)
REFERENCES `sites` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
UPDATE configurations SET version = '7.3', modified = now() WHERE id = 1;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

View file

@ -745,14 +745,14 @@ echo YouPHPTubePlugin::getManagerVideosJavaScripts();
clearTimeout(timeOut); clearTimeout(timeOut);
timeOut = setTimeout(function () { timeOut = setTimeout(function () {
$("#grid").bootgrid('reload'); $("#grid").bootgrid('reload');
}, 2000); }, 5000);
} else { } else {
} }
setTimeout(function () { setTimeout(function () {
checkProgress(); checkProgress();
}, 1000); }, 3000);
} else if (encodingNowId !== "") { } else if (encodingNowId !== "") {
$("#encodeProgress" + encodingNowId).slideUp("normal", function () { $("#encodeProgress" + encodingNowId).slideUp("normal", function () {
$(this).remove(); $(this).remove();
@ -760,11 +760,11 @@ echo YouPHPTubePlugin::getManagerVideosJavaScripts();
encodingNowId = ""; encodingNowId = "";
setTimeout(function () { setTimeout(function () {
checkProgress(); checkProgress();
}, 5000); }, 10000);
} else { } else {
setTimeout(function () { setTimeout(function () {
checkProgress(); checkProgress();
}, 5000); }, 10000);
} }
} }