1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00

Wrong download button

This commit is contained in:
DanieL 2022-04-26 14:26:57 -03:00
parent 6d2883076b
commit c3ecb22e78

View file

@ -174,6 +174,8 @@ if (User::hasBlockedUser($video['users_id'])) {
$videoHLSObj = AVideoPlugin::getDataObjectIfEnabled('VideoHLS');
if (!empty($videoHLSObj)) {
$cdnObj = AVideoPlugin::getDataObjectIfEnabled('CDN');
if(!empty($cdnObj) && $cdnObj->enable_storage){
if (!empty($videoHLSObj->saveMP4CopyOnCDNStorageToAllowDownload)) {
$filesToDownload[] = VideoHLS::getCDNDownloadLink($video['id'], 'mp4');
}
@ -181,6 +183,7 @@ if (User::hasBlockedUser($video['users_id'])) {
$filesToDownload[] = VideoHLS::getCDNDownloadLink($video['id'], 'mp3');
}
}
}
if (!empty($filesToDownload)) {
@ -258,6 +261,9 @@ if (User::hasBlockedUser($video['users_id'])) {
<div class="list-group list-group-horizontal">
<?php
foreach ($filesToDownload as $theLink) {
if(empty($theLink)){
continue;
}
if (preg_match('/\.json/i', $theLink['url'])) {
?>
<button type="button" onclick="downloadURLOrAlertError('<?php echo $theLink['url']; ?>', {}, '<?php echo $video['clean_title']; ?>.<?php echo strtolower($theLink['name']); ?>');"