1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
Also cleanup the encoder tmp folder
This commit is contained in:
DanieL 2023-02-15 09:33:04 -03:00
parent fca24b7b5e
commit e7fc048ef7

View file

@ -1,10 +1,22 @@
<?php <?php
if (!php_sapi_name() === 'cli') {
die('Command Line only');
}
//streamer config function humanFileSize($size, $unit = ""){
require_once '../videos/configuration.php'; if ((!$unit && $size >= 1 << 30) || $unit == "GB") {
return number_format($size / (1 << 30), 2) . "GB";
}
if (!isCommandLineInterface()) { if ((!$unit && $size >= 1 << 20) || $unit == "MB") {
return die('Command Line only'); return number_format($size / (1 << 20), 2) . "MB";
}
if ((!$unit && $size >= 1 << 10) || $unit == "KB") {
return number_format($size / (1 << 10), 2) . "KB";
}
return number_format($size) . " bytes";
} }
set_time_limit(300); set_time_limit(300);