1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

do not record if is rebroadcasting

This commit is contained in:
Daniel Neto 2024-01-05 15:49:23 -03:00
parent 06fa3284c8
commit a8893a5513
7 changed files with 75 additions and 46 deletions

View file

@ -10439,6 +10439,11 @@ function getValueOrBlank($array, $default=''){
return $text; return $text;
} }
function getRequestUniqueString(){
$text = getValueOrBlank(['app_bundle','ads_app_bundle', 'publisher_app_bundle']);
return $text;
}
require_once __DIR__.'/functionSecurity.php'; require_once __DIR__.'/functionSecurity.php';
require_once __DIR__.'/functionMySQL.php'; require_once __DIR__.'/functionMySQL.php';
require_once __DIR__.'/functionDocker.php'; require_once __DIR__.'/functionDocker.php';

View file

@ -4600,7 +4600,7 @@ if (!class_exists('Video')) {
{ {
global $global, $_getVideosPaths; global $global, $_getVideosPaths;
$cacheSuffix = "getVideosPaths_" . ($includeS3 ? 1 : 0) . ($_REQUEST['ads_app_bundle']); $cacheSuffix = "getVideosPaths_" . ($includeS3 ? 1 : 0) . getRequestUniqueString();
$videoCache = new VideoCacheHandler($filename); $videoCache = new VideoCacheHandler($filename);
$cache = $videoCache->getCache($cacheSuffix, 0); $cache = $videoCache->getCache($cacheSuffix, 0);

View file

@ -821,9 +821,9 @@ class API extends PluginAbstract
public function get_api_video($parameters) public function get_api_video($parameters)
{ {
$start = microtime(true); $start = microtime(true);
$cacheParameters = array('noRelated', 'APIName', 'catName', 'rowCount', 'APISecret', 'sort', 'searchPhrase', 'current', 'tags_id', 'channelName', 'videoType', 'is_serie', 'user', 'videos_id', 'playlist', 'ads_app_bundle'); $cacheParameters = array('noRelated', 'APIName', 'catName', 'rowCount', 'APISecret', 'sort', 'searchPhrase', 'current', 'tags_id', 'channelName', 'videoType', 'is_serie', 'user', 'videos_id', 'playlist');
$cacheVars = array('users_id' => User::getId()); $cacheVars = array('users_id' => User::getId(), 'requestUniqueString'=>getRequestUniqueString());
foreach ($cacheParameters as $value) { foreach ($cacheParameters as $value) {
$cacheVars[$value] = @$_REQUEST[$value]; $cacheVars[$value] = @$_REQUEST[$value];
} }

View file

@ -2419,6 +2419,13 @@ Click <a href=\"{link}\">here</a> to join our live.";
return Playlists_schedules::getDynamicDescription($ps['playlists_schedules']); return Playlists_schedules::getDynamicDescription($ps['playlists_schedules']);
} }
} }
if(AVideoPlugin::isEnabledByName('Rebroadcaster')){
$rb = Rebroadcaster::isKeyARebroadcast($key);;
if(!empty($rb) && !empty($rb['videos_id'])){
$video = new Video('', '', $rb['videos_id']);
return $video->getDescription();
}
}
if (empty($description)) { if (empty($description)) {
$description = $row['description']; $description = $row['description'];
} }
@ -2441,6 +2448,13 @@ Click <a href=\"{link}\">here</a> to join our live.";
return Playlists_schedules::getDynamicTitle($ps['playlists_schedules']); return Playlists_schedules::getDynamicTitle($ps['playlists_schedules']);
} }
} }
if(AVideoPlugin::isEnabledByName('Rebroadcaster')){
$rb = Rebroadcaster::isKeyARebroadcast($key);;
if(!empty($rb) && !empty($rb['videos_id'])){
$video = new Video('', '', $rb['videos_id']);
return $video->getTitle();
}
}
if (empty($title)) { if (empty($title)) {
$title = $row['title']; $title = $row['title'];
} }

View file

@ -295,6 +295,13 @@ class LiveTransmition extends ObjectYPT {
$row['title'] = Playlists_schedules::getDynamicTitle($row['title']); $row['title'] = Playlists_schedules::getDynamicTitle($row['title']);
} }
} }
if(AVideoPlugin::isEnabledByName('Rebroadcaster')){
$rb = Rebroadcaster::isKeyARebroadcast($key);;
if(!empty($rb) && !empty($rb['videos_id'])){
$video = new Video('', '', $rb['videos_id']);
$row['title'] = $video->getTitle();
}
}
} }
} else { } else {
$row = false; $row = false;

View file

@ -16,16 +16,22 @@ $islive = getLiveKey();
$liveStreamObject = new LiveStreamObject($islive['key'], $islive['live_servers_id'], @$_REQUEST['live_index'], 0); $liveStreamObject = new LiveStreamObject($islive['key'], $islive['live_servers_id'], @$_REQUEST['live_index'], 0);
$key = $liveStreamObject->getKeyWithIndex(true); $key = $liveStreamObject->getKeyWithIndex(true);
if(AVideoPlugin::isEnabledByName('PlayLists')){ if (AVideoPlugin::isEnabledByName('PlayLists')) {
$ps = Playlists_schedules::iskeyPlayListScheduled($key); $ps = Playlists_schedules::iskeyPlayListScheduled($key);
if(!empty($ps)){ if (!empty($ps)) {
$key = $ps['cleankey']; $key = $ps['cleankey'];
} }
} }
if (AVideoPlugin::isEnabledByName('Rebroadcaster')) {
$rb = Rebroadcaster::isKeyARebroadcast($key);;
if (!empty($rb) && !empty($rb['videos_id'])) {
$key = $rb['cleankey'];
}
}
//var_dump(getLiveKey(), $islive, $key);exit; //var_dump(getLiveKey(), $islive, $key);exit;
?> ?>
<style> <style>
#streamkey{ #streamkey {
border-top-left-radius: 0; border-top-left-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
} }
@ -55,7 +61,7 @@ if(AVideoPlugin::isEnabledByName('PlayLists')){
</div> </div>
<?php <?php
if (!empty($onliveApplications)) { if (!empty($onliveApplications)) {
?> ?>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<?php echo __('Active Livestreams'); ?> <?php echo __('Active Livestreams'); ?>
@ -64,7 +70,7 @@ if(AVideoPlugin::isEnabledByName('PlayLists')){
<?php echo implode('', $onliveApplications); ?> <?php echo implode('', $onliveApplications); ?>
</div> </div>
</div> </div>
<?php <?php
} }
?> ?>
@ -78,24 +84,24 @@ if(AVideoPlugin::isEnabledByName('PlayLists')){
</div> </div>
<div class="tabbable-line <?php echo getCSSAnimationClassAndStyle('animate__fadeInLeft', 'live'); ?>"> <div class="tabbable-line <?php echo getCSSAnimationClassAndStyle('animate__fadeInLeft', 'live'); ?>">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="active" > <li class="active">
<a data-toggle="tab" href="#tabStreamMetaData"><i class="fas fa-key"></i> <?php echo __("Stream Meta Data"); ?></a> <a data-toggle="tab" href="#tabStreamMetaData"><i class="fas fa-key"></i> <?php echo __("Stream Meta Data"); ?></a>
</li> </li>
<li class=""> <li class="">
<?php <?php
$url = "{$global['webSiteRootURL']}plugin/Live/view/Live_schedule/uploadPoster.php"; $url = "{$global['webSiteRootURL']}plugin/Live/view/Live_schedule/uploadPoster.php";
$url = addQueryStringParameter($url,'live_schedule_id',@$_REQUEST['live_schedule_id']); $url = addQueryStringParameter($url, 'live_schedule_id', @$_REQUEST['live_schedule_id']);
$url = addQueryStringParameter($url,'live_servers_id',@$_REQUEST['live_servers_id']); $url = addQueryStringParameter($url, 'live_servers_id', @$_REQUEST['live_servers_id']);
?> ?>
<a style="cursor: pointer;" onclick="avideoModalIframe('<?php echo $url; ?>');"><i class="fas fa-images"></i> <?php echo __("Poster Image"); ?></a> <a style="cursor: pointer;" onclick="avideoModalIframe('<?php echo $url; ?>');"><i class="fas fa-images"></i> <?php echo __("Poster Image"); ?></a>
</li> </li>
<?php <?php
if (empty($objLive->hideUserGroups)) { if (empty($objLive->hideUserGroups)) {
?> ?>
<li class="" > <li class="">
<a data-toggle="tab" href="#tabUserGroups"><i class="fas fa-users"></i> <?php echo __("User Groups"); ?></a> <a data-toggle="tab" href="#tabUserGroups"><i class="fas fa-users"></i> <?php echo __("User Groups"); ?></a>
</li> </li>
<?php <?php
} }
?> ?>
</ul> </ul>
@ -104,32 +110,32 @@ if(AVideoPlugin::isEnabledByName('PlayLists')){
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><i class="fas fa-cog"></i> <?php echo __("Stream Settings"); ?></div> <div class="panel-heading"><i class="fas fa-cog"></i> <?php echo __("Stream Settings"); ?></div>
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<label for="title"><?php echo __("Title"); ?>:</label> <label for="title"><?php echo __("Title"); ?>:</label>
<input type="text" class="form-control" id="title" value="<?php echo $trasnmition['title'] ?>"> <input type="text" class="form-control" id="title" value="<?php echo $trasnmition['title'] ?>">
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="title"><?php echo __("Password Protect"); ?>:</label> <label for="title"><?php echo __("Password Protect"); ?>:</label>
<?php <?php
echo getInputPassword('password_livestream', 'class="form-control" autocomplete="off" autofill="off" value="' . $trasnmition['password'] . '"', __("Password Protect")); echo getInputPassword('password_livestream', 'class="form-control" autocomplete="off" autofill="off" value="' . $trasnmition['password'] . '"', __("Password Protect"));
?> ?>
</div> </div>
<?php <?php
if (!empty($objLive->hidePublicListedOption)) { if (!empty($objLive->hidePublicListedOption)) {
?> ?>
<input id="listed" type="hidden" value="1"/> <input id="listed" type="hidden" value="1" />
<?php <?php
} else { } else {
?> ?>
<div class="form-group"> <div class="form-group">
<span class="fa fa-globe"></span> <?php echo __("Make Stream Publicly Listed"); ?> <span class="fa fa-globe"></span> <?php echo __("Make Stream Publicly Listed"); ?>
<div class="material-switch pull-right"> <div class="material-switch pull-right">
<input id="listed" type="checkbox" value="1" <?php echo!empty($trasnmition['public']) ? "checked" : ""; ?> onchange="saveStream();"/> <input id="listed" type="checkbox" value="1" <?php echo !empty($trasnmition['public']) ? "checked" : ""; ?> onchange="saveStream();" />
<label for="listed" class="label-success"></label> <label for="listed" class="label-success"></label>
</div> </div>
</div> </div>
<?php <?php
@ -138,21 +144,22 @@ if(AVideoPlugin::isEnabledByName('PlayLists')){
$SendRecordedToEncoderClassExists = class_exists('SendRecordedToEncoder'); $SendRecordedToEncoderClassExists = class_exists('SendRecordedToEncoder');
$SendRecordedToEncoderMethodExists = method_exists('SendRecordedToEncoder', 'canAutoRecord'); $SendRecordedToEncoderMethodExists = method_exists('SendRecordedToEncoder', 'canAutoRecord');
if ( if (
$SendRecordedToEncoderObjectData && $SendRecordedToEncoderObjectData &&
$SendRecordedToEncoderClassExists && $SendRecordedToEncoderClassExists &&
$SendRecordedToEncoderMethodExists) { $SendRecordedToEncoderMethodExists
) {
$SendRecordedToEncoderCanAutoRecord = SendRecordedToEncoder::canAutoRecord(User::getId()); $SendRecordedToEncoderCanAutoRecord = SendRecordedToEncoder::canAutoRecord(User::getId());
$SendRecordedToEncoderCanApprove = SendRecordedToEncoder::canApprove(User::getId()); $SendRecordedToEncoderCanApprove = SendRecordedToEncoder::canApprove(User::getId());
if ($SendRecordedToEncoderCanAutoRecord || ($SendRecordedToEncoderCanApprove && $SendRecordedToEncoderObjectData->usersCanSelectAutoRecord)) { if ($SendRecordedToEncoderCanAutoRecord || ($SendRecordedToEncoderCanApprove && $SendRecordedToEncoderObjectData->usersCanSelectAutoRecord)) {
?> ?>
<div class="form-group"> <div class="form-group">
<span class="fa fa-globe"></span> <?php echo __("Auto record this live"); ?> <span class="fa fa-globe"></span> <?php echo __("Auto record this live"); ?>
<div class="material-switch pull-right"> <div class="material-switch pull-right">
<input id="recordLive" type="checkbox" value="1" <?php echo SendRecordedToEncoder::userApproved(User::getId()) ? "checked" : ""; ?> onchange="saveStream();"/> <input id="recordLive" type="checkbox" value="1" <?php echo SendRecordedToEncoder::userApproved(User::getId()) ? "checked" : ""; ?> onchange="saveStream();" />
<label for="recordLive" class="label-success"></label> <label for="recordLive" class="label-success"></label>
</div> </div>
</div> </div>
<?php <?php
} else { } else {
if (!$SendRecordedToEncoderCanAutoRecord) { if (!$SendRecordedToEncoderCanAutoRecord) {
echo '<!-- Cannot auto record -->'; echo '<!-- Cannot auto record -->';
@ -174,36 +181,36 @@ if(AVideoPlugin::isEnabledByName('PlayLists')){
<?php <?php
echo Layout::getCategorySelect('categories_id', $trasnmition['categories_id']); echo Layout::getCategorySelect('categories_id', $trasnmition['categories_id']);
?> ?>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="description"><?php echo __("Description"); ?>:</label> <label for="description"><?php echo __("Description"); ?>:</label>
<textarea rows="6" class="form-control" id="description"><?php echo $trasnmition['description'] ?></textarea> <textarea rows="6" class="form-control" id="description"><?php echo $trasnmition['description'] ?></textarea>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
<button type="button" class="btn btn-success btn-block btnSaveStream" id="btnSaveStream"><i class="fas fa-save"></i> <?php echo __("Save Stream Settings"); ?></button> <button type="button" class="btn btn-success btn-block btnSaveStream" id="btnSaveStream"><i class="fas fa-save"></i> <?php echo __("Save Stream Settings"); ?></button>
</div> </div>
</div> </div>
</div> </div>
<div id="tabUserGroups" class="tab-pane fade"> <div id="tabUserGroups" class="tab-pane fade">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><?php echo __("Groups That Can See This Stream"); ?><br><small><?php echo __("Uncheck all to make it public"); ?></small></div> <div class="panel-heading"><?php echo __("Groups That Can See This Stream"); ?><br><small><?php echo __("Uncheck all to make it public"); ?></small></div>
<div class="panel-body"> <div class="panel-body">
<?php <?php
$ug = UserGroups::getAllUsersGroups(); $ug = UserGroups::getAllUsersGroups();
foreach ($ug as $value) { foreach ($ug as $value) {
?> ?>
<div class="form-group"> <div class="form-group">
<span class="fa fa-users"></span> <?php echo $value['group_name']; ?> <span class="fa fa-users"></span> <?php echo $value['group_name']; ?>
<div class="material-switch pull-right"> <div class="material-switch pull-right">
<input id="group<?php echo $value['id']; ?>" type="checkbox" value="<?php echo $value['id']; ?>" class="userGroups" <?php echo(in_array($value['id'], $groups) ? "checked" : "") ?>/> <input id="group<?php echo $value['id']; ?>" type="checkbox" value="<?php echo $value['id']; ?>" class="userGroups" <?php echo (in_array($value['id'], $groups) ? "checked" : "") ?> />
<label for="group<?php echo $value['id']; ?>" class="label-success"></label> <label for="group<?php echo $value['id']; ?>" class="label-success"></label>
</div> </div>
</div> </div>
<?php <?php
} }
?> ?>
</div> </div>
@ -213,8 +220,5 @@ if(AVideoPlugin::isEnabledByName('PlayLists')){
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -2,7 +2,6 @@
header('Content-Type: application/json'); header('Content-Type: application/json');
require_once '../../../../videos/configuration.php'; require_once '../../../../videos/configuration.php';
require_once $global['systemRootPath'] . 'plugin/PlayLists/Objects/Playlists_schedules.php'; require_once $global['systemRootPath'] . 'plugin/PlayLists/Objects/Playlists_schedules.php';
$obj = new stdClass(); $obj = new stdClass();
$obj->error = true; $obj->error = true;
$obj->msg = ""; $obj->msg = "";