aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-05-25 18:31:29 -0500
committerJesús <heckyel@hyperbola.info>2019-05-25 18:31:29 -0500
commite07065d2a123fcb419db1be06510e05cf15836c7 (patch)
treee564c4d5c2520e320a9fea407c105c0eb7a0253e
parentaa77f45e0a4f4dce5d12056562c1b63e3759a802 (diff)
downloadytlibre-e07065d2a123fcb419db1be06510e05cf15836c7.tar.lz
ytlibre-e07065d2a123fcb419db1be06510e05cf15836c7.tar.xz
ytlibre-e07065d2a123fcb419db1be06510e05cf15836c7.zip
BugFix: Not mixed php and HTML
-rw-r--r--index.php17
-rw-r--r--templates/video.tpl47
-rw-r--r--tools/processor.php27
3 files changed, 59 insertions, 32 deletions
diff --git a/index.php b/index.php
index ff1be94..0181cb8 100644
--- a/index.php
+++ b/index.php
@@ -30,11 +30,26 @@ if (empty($_GET['link'])){
$video_decode->assign("videoViews", $videoViews);
$video_decode->assign("librethumb", $librethumb);
+ // Downloads
$video_decode->assign("downloads", $downloads);
- $video_decode->assign("breakdownload", $breakdownload);
+
+ // Videos Loop
$video_decode->assign("streamFormats", $streamFormats);
+ // URL DRM
+ $video_decode->assign("breakurl", $breakurl);
+
+ // Download DRM
+ $video_decode->assign("downloadbreak", $downloadbreak);
+ $video_decode->assign("downloadQuality", $downloadQuality);
+ $video_decode->assign("downloadFormat", $downloadFormat);
+
+ // Video DRM
$video_decode->assign("breaklink", $breaklink);
+ $video_decode->assign("breakquality", $breakquality);
+ $video_decode->assign("formatdrm", $formatdrm);
+
+ // Base link
$video_decode->assign("baselink", $baselink);
/* ---- ---- CSS ---- ---- */
diff --git a/templates/video.tpl b/templates/video.tpl
index 0bb1c9d..ccdbf5a 100644
--- a/templates/video.tpl
+++ b/templates/video.tpl
@@ -58,7 +58,7 @@
<div class="contenedor">
<div class="row">
<div class="imageyt">
- <img alt="{$videoTitle}" src="{$videoThumbURL}"/>
+ <img alt='{$videoTitle}' src="{$videoThumbURL}"/>
</div>
<div class="features">
<h6 class="yt-titulo">Canal</h6>
@@ -73,29 +73,48 @@
<hr>
<div class="contenedor">
<h4>Formatos de vídeo</h4>
- {foreach $downloads as $download}
+
+ {if $downloadbreak === TRUE}
<div class="row">
- <div class="col">{$download->container}</div>
- <div class="col">{$download->resolution}</div>
+ <div class="col">{$downloadFormat}</div>
+ <div class="col">{$downloadQuality}</div>
<div class="col">
- <a class="boton-descarga" title="{$videoTitle}.{$download->container}" href="{$download->url}" download="{$videoTitle}.{$download->container}">Descarga</a>
+ <a class="boton-descarga" href="{$breakurl}"
+ title='{$videoTitle}.{$downloadFormat}'
+ download='{$videoTitle}.{$downloadFormat}'>Descarga Habilitada</a>
</div>
</div>
+ {else}
+ {foreach $downloads as $download}
+ <div class="row">
+ <div class="col">{$download->container}</div>
+ <div class="col">{$download->resolution}</div>
+ <div class="col">
+ <a class="boton-descarga"
+ title='{$videoTitle}.{$download->container}'
+ href="{$download->url}"
+ download='{$videoTitle}.{$download->container}'>Descarga</a>
+ </div>
+ </div>
{/foreach}
- {$breakdownload}
+ {/if}
+
<div class="librevideojs">
<video id="player"
poster="{$librethumb}"
controls
playsinline
- onmouseleave="{$videoTitle}"
- oncontextmenu="{$videoTitle}"
- onmouseenter="{$videoTitle}"
- title="{$videoTitle}">
- {$breaklink}
- {foreach $streamFormats as $stream}
- <source data-res="{trim($stream->resolution, 'p')}" src="{$stream->url}" type='{$stream->type}'/>
- {/foreach}
+ onmouseleave='{$videoTitle}'
+ oncontextmenu='{$videoTitle}'
+ onmouseenter='{$videoTitle}'
+ title='{$videoTitle}'>
+ {if $breaklink === TRUE}
+ <source data-res="{$breakquality}" src="{$breakurl}" type='{$formatdrm}'/>
+ {else}
+ {foreach $streamFormats as $stream}
+ <source data-res="{trim($stream->resolution, 'p')}" src="{$stream->url}" type='{$stream->type}'/>
+ {/foreach}
+ {/if}
<p>Lo siento, este navegador no soporta vídeo en HTML5. Por favor, cambia o actualiza tu navegador web</p>
</video>
</div>
diff --git a/tools/processor.php b/tools/processor.php
index ce24569..79470ee 100644
--- a/tools/processor.php
+++ b/tools/processor.php
@@ -102,25 +102,18 @@ if ( $url_standar === FALSE ) {
// liberty data
$breakquality = trim( $streamFormats[0]->resolution, 'p' );
- $breaklink = <<<EOT
-<source data-res="{$breakquality}" src="{$breakurl}" type='{$formatdrm}'/>
-EOT;
+ $breaklink = TRUE;
$downloadFormat = $downloads[0]->container;
$downloadQuality = $streamFormats[0]->resolution;
- $breakdownload = <<<EOT
-<div class="row">
- <div class="col">{$downloadFormat}</div>
- <div class="col">{$downloadQuality}</div>
- <div class="col">
- <a class="boton-descarga" href="{$breakurl}" title="{$videoTitle}.{$downloadFormat}" download="{$videoTitle}.{$downloadFormat}">Descarga Habilitada</a>
- </div>
-</div>
-EOT;
+ $downloadbreak = TRUE;
} else {
- $breaklink = '';
- $breakdownload = '';
+ // clean variables
+ $breakurl = NULL;
+ $breaklink = NULL;
+ $breakquality = NULL;
+ $downloadbreak = NULL;
+ $downloadFormat = NULL;
+ $downloadQuality = NULL;
+ $formatdrm = NULL;
}
///// End Beaking DRM!!!
-
-// // Captions
-// $streamCaptions = $video_info->captions;