mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
Update
This commit is contained in:
parent
16746017f0
commit
21d3f82c0d
1 changed files with 29 additions and 0 deletions
29
install/fixDurationHLS.php
Normal file
29
install/fixDurationHLS.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
//streamer config
|
||||
require_once '../videos/configuration.php';
|
||||
|
||||
if (!isCommandLineInterface()) {
|
||||
return die('Command Line only');
|
||||
}
|
||||
|
||||
if(!AVideoPlugin::isEnabledByName('VideoHLS')){
|
||||
return die('VideoHLS disabled');
|
||||
}
|
||||
|
||||
ob_end_flush();
|
||||
$global['limitForUnlimitedVideos'] = -1;
|
||||
$videos = video::getAllVideosLight("", false, true);
|
||||
$count = 0;
|
||||
$total = count();
|
||||
foreach ($videos as $value) {
|
||||
$count++;
|
||||
|
||||
if(!Video::isValidDuration($value['duration'])){
|
||||
$v = new Video('', '', $value['id'], true);
|
||||
if(VideoHLS::updateHLSDurationIfNeed($v)){
|
||||
echo "[{$count}/{$total}] Success updated [{$value['id']}] ".$v->getDuration().PHP_EOL;
|
||||
}else{
|
||||
echo "[{$count}/{$total}] ERROR updated [{$value['id']}] ".$v->getDuration().PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue