mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
Also cleanup the encoder tmp folder
This commit is contained in:
parent
fca24b7b5e
commit
e7fc048ef7
1 changed files with 16 additions and 4 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue