1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00
Oinktube/install/deleteTGZFiles.php
Daniel 2a9630258f https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556
Also check the lang in case insensitive
2022-03-14 14:28:38 -03:00

25 lines
705 B
PHP

<?php
//streamer config
require_once '../videos/configuration.php';
ob_end_flush();
if (!isCommandLineInterface()) {
return die('Command Line only');
}
$path = getVideosDir();
$files = array_diff(scandir($path), ['.', '..']);
foreach ($files as $value) {
$dir = "{$path}{$value}";
if (is_dir($dir)) {
$files2 = array_diff(scandir($dir), ['.', '..']);
foreach ($files2 as $value2) {
$ext = pathinfo($value2, PATHINFO_EXTENSION);
if ($ext=='tgz') {
$file = "{$dir}/{$value2}";
echo $file.' '. humanFileSize(filesize($file)).PHP_EOL;
unlink($file);
}
}
}
}