More info about formats

Only HTTP formats
This commit is contained in:
Pierre Rudloff 2016-04-11 01:21:01 +02:00
parent c6c2214567
commit 7d548c06b6
4 changed files with 104 additions and 60 deletions

View file

@ -3,7 +3,7 @@ python: /usr/bin/python
params: params:
- --no-playlist - --no-playlist
- --no-warnings - --no-warnings
- -f best - -f best[protocol^=http]
curl_params: curl_params:
convert: false convert: false
avconv: vendor/bin/ffmpeg avconv: vendor/bin/ffmpeg

View file

@ -113,7 +113,7 @@ class FrontController
if (isset($params['audio'])) { if (isset($params['audio'])) {
try { try {
try { try {
$url = $this->download->getURL($params["url"], 'bestaudio'); $url = $this->download->getURL($params["url"], 'bestaudio[protocol^=http]');
return $response->withRedirect($url); return $response->withRedirect($url);
} catch (\Exception $e) { } catch (\Exception $e) {
$video = $this->download->getJSON($params["url"]); $video = $this->download->getJSON($params["url"]);

View file

@ -8,8 +8,8 @@ body {
/************************HEADER******************************/ /************************HEADER******************************/
header { header {
position:absolute; position:absolute;
top:0; top:0;
@ -17,11 +17,11 @@ header {
width:100%; width:100%;
padding:0; padding:0;
} }
.social .social
{padding-right:21px;} {padding-right:21px;}
header a header a
{ {
overflow:hidden; overflow:hidden;
@ -37,7 +37,7 @@ background-repeat:no-repeat;
-webkit-transition: all 0.1s ease-in; -webkit-transition: all 0.1s ease-in;
-moz-transition: all 0.1s ease-in; -moz-transition: all 0.1s ease-in;
-o-transition: all 0.1s ease-in; -o-transition: all 0.1s ease-in;
} }
header a:focus, header a:focus,
header a:hover header a:hover
@ -51,8 +51,8 @@ header a:hover
.share .share
{background-image:url('../img/share.png');} {background-image:url('../img/share.png');}
.sharemask .sharemask
{ {
height:38px; height:38px;
width:38px; width:38px;
@ -64,11 +64,11 @@ background-image:url('../img/sharemask.png');
background-position:top left; background-position:top left;
background-repeat:no-repeat; background-repeat:no-repeat;
} }
.facebook .facebook
{background-image:url('../img/facebook.png');} {background-image:url('../img/facebook.png');}
.facebookmask .facebookmask
{ {
height:38px; height:38px;
width:38px; width:38px;
@ -79,12 +79,12 @@ z-index:10;
background-image:url('../img/facebookmask.png'); background-image:url('../img/facebookmask.png');
background-position:top left; background-position:top left;
background-repeat:no-repeat; background-repeat:no-repeat;
} }
.twitter .twitter
{background-image:url('../img/twitter.png');} {background-image:url('../img/twitter.png');}
.twittermask .twittermask
{ {
height:38px; height:38px;
width:38px; width:38px;
@ -95,13 +95,13 @@ z-index:10;
background-image:url('../img/twittermask.png'); background-image:url('../img/twittermask.png');
background-position:top left; background-position:top left;
background-repeat:no-repeat; background-repeat:no-repeat;
} }
/*************************FOOTER****************************/ /*************************FOOTER****************************/
footer { footer {
position:fixed; position:fixed;
bottom:0; bottom:0;
@ -119,7 +119,7 @@ footer {
.footer_wrapper { .footer_wrapper {
height:28px; height:28px;
} }
footer a{ footer a{
color:#adadad; color:#adadad;
-webkit-transition: all 0.1s ease-in; -webkit-transition: all 0.1s ease-in;
@ -137,7 +137,7 @@ color:#f2084a;
-moz-transition: all 0.1s ease-in; -moz-transition: all 0.1s ease-in;
-o-transition: all 0.1s ease-in; -o-transition: all 0.1s ease-in;
} }
@ -180,7 +180,7 @@ margin-top:8px;
text-decoration:none; text-decoration:none;
display:inline-block; display:inline-block;
} }
.downloadBtn:focus, .downloadBtn:focus,
.downloadBtn:hover .downloadBtn:hover
{ {
@ -248,7 +248,7 @@ color:#f2084a;
-moz-transition: all 0.1s ease-in; -moz-transition: all 0.1s ease-in;
-o-transition: all 0.1s ease-in; -o-transition: all 0.1s ease-in;
} }
#bookmarklet{ #bookmarklet{
padding:15px; padding:15px;
} }
@ -265,7 +265,7 @@ padding-top:10px;
padding-bottom:10px; padding-bottom:10px;
border: 2px dotted; border: 2px dotted;
} }
.mp3 .mp3
{ {
position:relative; position:relative;
@ -279,17 +279,17 @@ border: 2px dotted;
text-align:left; text-align:left;
font-weight:300; font-weight:300;
} }
.mp3 p .mp3 p
{ {
padding:3px; padding:3px;
} }
/* /*
Demo CSS code Demo CSS code
*/ */
.audio:not(:checked), .audio:not(:checked),
.audio:checked { .audio:checked {
position: absolute; position: absolute;
@ -337,10 +337,10 @@ padding:3px;
.audio:focus + label { .audio:focus + label {
color:black; color:black;
} }
/* on checked */ /* on checked */
.audio:checked + label:before { .audio:checked + label:before {
background:#f2084a; background:#f2084a;
} }
.audio:checked + label:after { .audio:checked + label:after {
background: #fff; background: #fff;
@ -402,7 +402,7 @@ padding:3px;
/*************************CONTENT COMPATIBLES****************************/ /*************************CONTENT COMPATIBLES****************************/
@ -565,24 +565,28 @@ h1 {
margin-bottom: 1em; margin-bottom: 1em;
} }
.monospace {
font-family:monospace;
}
@media (max-width: 640px) { @media (max-width: 640px) {
.thumb { .thumb {
width:90%; width:90%;
} }
.URLinput{ .URLinput{
min-width:0; min-width:0;
} }
.logo { .logo {
max-width:330px; max-width:330px;
} }
.logocompatible, .logocompatible,
.logocompatible img { .logocompatible img {
max-width:447px; max-width:447px;
} }
.logocompatible, .logocompatible,
.logo, .logo,
.champs, .champs,
@ -592,64 +596,64 @@ h1 {
margin:auto; margin:auto;
height:auto; height:auto;
} }
.logo { .logo {
margin-top:50px; margin-top:50px;
} }
.logocompatible img { .logocompatible img {
width:100%; width:100%;
height: auto; height: auto;
} }
.downloadBtn { .downloadBtn {
margin-top: 0.3em; margin-top: 0.3em;
} }
.mp3 { .mp3 {
margin-bottom: 1em; margin-bottom: 1em;
} }
footer { footer {
display:none; display:none;
} }
.tripleliste ul, .tripleliste ul,
.tripleliste { .tripleliste {
width:auto; width:auto;
margin-left:auto; margin-left:auto;
margin-top:auto; margin-top:auto;
} }
.logocompatiblemask { .logocompatiblemask {
background:none; background:none;
} }
.logocompatible { .logocompatible {
height:auto; height:auto;
background-image:none; background-image:none;
background-color:#4F4F4F; background-color:#4F4F4F;
} }
.logocompatiblemask, .logocompatiblemask,
.logobis { .logobis {
width:auto; width:auto;
} }
.logocompatiblemask { .logocompatiblemask {
position:static; position:static;
} }
.logobis { .logobis {
height:auto; height:auto;
} }
.titre { .titre {
margin:auto; margin:auto;
} }
.error p { .error p {
padding:0.5em; padding:0.5em;
text-align:left; text-align:left;
} }
} }

View file

@ -26,25 +26,65 @@
<h3><label for="format">Available formats:</label></h3> <h3><label for="format">Available formats:</label></h3>
<form action="{path_for name="redirect"}"> <form action="{path_for name="redirect"}">
<input type="hidden" name="url" value="{$video->webpage_url}" /> <input type="hidden" name="url" value="{$video->webpage_url}" />
<select name="format" id="format"> <select name="format" id="format" class="monospace">
<option value="best"> <optgroup label="Generic formats">
Best ({$video->ext}) <option value="best[protocol^=http]">
</option> {strip}
<option value="worst"> Best ({$video->ext}
Worst {if isset($video->filesize)}
</option> {$video->filesize}
<optgroup label="Other formats"> {/if}
)
{/strip}
</option>
<option value="worst[protocol^=http]">
Worst
</option>
</optgroup>
<optgroup label="Detailed formats" class="monospace">
{foreach $video->formats as $format} {foreach $video->formats as $format}
<option value="{$format->format_id}"> {$format->protocol}
{$format->format} ({$format->ext}) {if $format->protocol|in_array:array('http', 'https')}
</option> {strip}
<option value="{$format->format_id}">
{$format->ext}
{for $foo=1 to (5 - ($format->ext|strlen))}
&nbsp;
{/for}
{if isset($format->width)}
{$format->width}x{$format->height}
{for $foo=1 to (10 - (("{$format->width}x{$format->height}")|strlen))}
&nbsp;
{/for}
{else}
{for $foo=1 to 10}
&nbsp;
{/for}
{/if}
{if isset($format->filesize)}
{($format->filesize/1000000)|round:2} MB
{for $foo=1 to (7 - (($format->filesize/1000000)|round:2|strlen))}
&nbsp;
{/for}
{else}
{for $foo=1 to 10}
&nbsp;
{/for}
{/if}
{if isset($format->format_note)}
{$format->format_note}
{/if}
&nbsp;({$format->format_id})
</option>
{/strip}
{/if}
{/foreach} {/foreach}
</optgroup> </optgroup>
</select><br/><br/> </select><br/><br/>
<input class="downloadBtn" type="submit" value="Download" /><br/> <input class="downloadBtn" type="submit" value="Download" /><br/>
</form> </form>
{else} {else}
<input type="hidden" name="format" value="best" /> <input type="hidden" name="format" value="best[protocol^=http]" />
<a class="downloadBtn" <a class="downloadBtn"
href="{$video->url|escape}">Download</a><br/> href="{$video->url|escape}">Download</a><br/>
{/if} {/if}