Skip to content
Permalink
Browse files
More info about formats
Only HTTP formats
  • Loading branch information
Rudloff committed Apr 10, 2016
1 parent c6c2214 commit 7d548c06b6ac2d9bee2931c6211903df38370d5f
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 60 deletions.
@@ -3,7 +3,7 @@ python: /usr/bin/python
params:
- --no-playlist
- --no-warnings
- -f best
- -f best[protocol^=http]
curl_params:
convert: false
avconv: vendor/bin/ffmpeg
@@ -113,7 +113,7 @@ public function video($request, $response)
if (isset($params['audio'])) {
try {
try {
$url = $this->download->getURL($params["url"], 'bestaudio');
$url = $this->download->getURL($params["url"], 'bestaudio[protocol^=http]');
return $response->withRedirect($url);
} catch (\Exception $e) {
$video = $this->download->getJSON($params["url"]);
@@ -8,20 +8,20 @@ body {



/************************HEADER******************************/
/************************HEADER******************************/

header {
position:absolute;
top:0;
text-align:right;
width:100%;
padding:0;
}

.social
{padding-right:21px;}


header a
{
overflow:hidden;
@@ -37,7 +37,7 @@ background-repeat:no-repeat;
-webkit-transition: all 0.1s ease-in;
-moz-transition: all 0.1s ease-in;
-o-transition: all 0.1s ease-in;
}
}

header a:focus,
header a:hover
@@ -51,8 +51,8 @@ header a:hover

.share
{background-image:url('../img/share.png');}
.sharemask

.sharemask
{
height:38px;
width:38px;
@@ -64,11 +64,11 @@ background-image:url('../img/sharemask.png');
background-position:top left;
background-repeat:no-repeat;
}

.facebook
{background-image:url('../img/facebook.png');}
.facebookmask

.facebookmask
{
height:38px;
width:38px;
@@ -79,12 +79,12 @@ z-index:10;
background-image:url('../img/facebookmask.png');
background-position:top left;
background-repeat:no-repeat;
}
}

.twitter
{background-image:url('../img/twitter.png');}
.twittermask

.twittermask
{
height:38px;
width:38px;
@@ -95,13 +95,13 @@ z-index:10;
background-image:url('../img/twittermask.png');
background-position:top left;
background-repeat:no-repeat;
}
}




/*************************FOOTER****************************/


footer {
position:fixed;
bottom:0;
@@ -119,7 +119,7 @@ footer {
.footer_wrapper {
height:28px;
}

footer a{
color:#adadad;
-webkit-transition: all 0.1s ease-in;
@@ -137,7 +137,7 @@ color:#f2084a;
-moz-transition: all 0.1s ease-in;
-o-transition: all 0.1s ease-in;
}




@@ -180,7 +180,7 @@ margin-top:8px;
text-decoration:none;
display:inline-block;
}

.downloadBtn:focus,
.downloadBtn:hover
{
@@ -248,7 +248,7 @@ color:#f2084a;
-moz-transition: all 0.1s ease-in;
-o-transition: all 0.1s ease-in;
}

#bookmarklet{
padding:15px;
}
@@ -265,7 +265,7 @@ padding-top:10px;
padding-bottom:10px;
border: 2px dotted;
}

.mp3
{
position:relative;
@@ -279,17 +279,17 @@ border: 2px dotted;
text-align:left;
font-weight:300;
}

.mp3 p
{
padding:3px;
}
}


/*
Demo CSS code
*/

.audio:not(:checked),
.audio:checked {
position: absolute;
@@ -337,10 +337,10 @@ padding:3px;
.audio:focus + label {
color:black;
}

/* on checked */
.audio:checked + label:before {
background:#f2084a;
background:#f2084a;
}
.audio:checked + label:after {
background: #fff;
@@ -402,7 +402,7 @@ padding:3px;





/*************************CONTENT COMPATIBLES****************************/

@@ -565,24 +565,28 @@ h1 {
margin-bottom: 1em;
}

.monospace {
font-family:monospace;
}

@media (max-width: 640px) {
.thumb {
width:90%;
}

.URLinput{
min-width:0;
}

.logo {
max-width:330px;
}

.logocompatible,
.logocompatible img {
max-width:447px;
}

.logocompatible,
.logo,
.champs,
@@ -592,64 +596,64 @@ h1 {
margin:auto;
height:auto;
}

.logo {
margin-top:50px;
}

.logocompatible img {
width:100%;
height: auto;
}

.downloadBtn {
margin-top: 0.3em;
}
.mp3 {
margin-bottom: 1em;
}

footer {
display:none;
}

.tripleliste ul,
.tripleliste {
width:auto;
margin-left:auto;
margin-top:auto;
}

.logocompatiblemask {
background:none;
}

.logocompatible {
height:auto;
background-image:none;
background-color:#4F4F4F;
}

.logocompatiblemask,
.logobis {
width:auto;
}

.logocompatiblemask {
position:static;
}

.logobis {
height:auto;
}

.titre {
margin:auto;
}

.error p {
padding:0.5em;
text-align:left;
}

}
@@ -26,25 +26,65 @@
<h3><label for="format">Available formats:</label></h3>
<form action="{path_for name="redirect"}">
<input type="hidden" name="url" value="{$video->webpage_url}" />
<select name="format" id="format">
<option value="best">
Best ({$video->ext})
</option>
<option value="worst">
Worst
</option>
<optgroup label="Other formats">
<select name="format" id="format" class="monospace">
<optgroup label="Generic formats">
<option value="best[protocol^=http]">
{strip}
Best ({$video->ext}
{if isset($video->filesize)}
{$video->filesize}
{/if}
)
{/strip}
</option>
<option value="worst[protocol^=http]">
Worst
</option>
</optgroup>
<optgroup label="Detailed formats" class="monospace">
{foreach $video->formats as $format}
<option value="{$format->format_id}">
{$format->format} ({$format->ext})
</option>
{$format->protocol}
{if $format->protocol|in_array:array('http', 'https')}
{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}
</optgroup>
</select><br/><br/>
<input class="downloadBtn" type="submit" value="Download" /><br/>
</form>
{else}
<input type="hidden" name="format" value="best" />
<input type="hidden" name="format" value="best[protocol^=http]" />
<a class="downloadBtn"
href="{$video->url|escape}">Download</a><br/>
{/if}

0 comments on commit 7d548c0

Please sign in to comment.