Merge branch 'release-0.4.5'

This commit is contained in:
Pierre Rudloff 2016-03-15 23:12:55 +01:00
commit f4fef05c9f
16 changed files with 183 additions and 119 deletions

View file

@ -11,3 +11,6 @@ FileETag None
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
Redirect permanent /api.php /video
Redirect permanent /extractors.php /extractors

View file

@ -19,6 +19,8 @@ You should also ensure that the *templates_c* folder has the right permissions:
chmod 777 templates_c/
If your web server is Apache, you need to set the `AllowOverride` setting to `All` or `FileInfo`.
##Config
If you want to use a custom config, you need to create a config file:
@ -37,4 +39,6 @@ If you don't want to enable conversions, you can disable it in *config.yml*.
On Debian-based systems:
sudo apt-get install libavcodec-extra rtmpdump
sudo apt-get install libav-tools rtmpdump
You also probably need to edit the *avconv* variable in *config.yml* so that it points to your ffmpeg/avconv binary (*/usr/bin/avconv* on Debian/Ubuntu).

View file

@ -32,6 +32,7 @@ Class Config
public $params = '--no-playlist --no-warnings -f best';
public $convert = false;
public $avconv = 'vendor/bin/ffmpeg';
public $curl_params = '';
/**
* Config constructor
@ -56,6 +57,7 @@ Class Config
/**
* Get singleton instance
*
* @return Config
*/
public static function getInstance()

View file

@ -32,8 +32,12 @@ Class VideoDownload
static function getUA()
{
$config = Config::getInstance();
$cmd = escapeshellcmd(
$config->python.' '.escapeshellarg($config->youtubedl).
' '.$config->params
);
exec(
$config->python.' '.$config->youtubedl.' --dump-user-agent',
$cmd.' --dump-user-agent',
$version
);
return $version[0];
@ -47,8 +51,12 @@ Class VideoDownload
static function listExtractors()
{
$config = Config::getInstance();
$cmd = escapeshellcmd(
$config->python.' '.escapeshellarg($config->youtubedl).
' '.$config->params
);
exec(
$config->python.' '.$config->youtubedl.' --list-extractors',
$cmd.' --list-extractors',
$extractors
);
return $extractors;
@ -65,7 +73,10 @@ Class VideoDownload
static function getFilename($url, $format=null)
{
$config = Config::getInstance();
$cmd=$config->python.' '.$config->youtubedl;
$cmd = escapeshellcmd(
$config->python.' '.escapeshellarg($config->youtubedl).
' '.$config->params
);
if (isset($format)) {
$cmd .= ' -f '.escapeshellarg($format);
}
@ -88,7 +99,10 @@ Class VideoDownload
static function getJSON($url, $format=null)
{
$config = Config::getInstance();
$cmd=$config->python.' '.$config->youtubedl.' '.$config->params;
$cmd = escapeshellcmd(
$config->python.' '.escapeshellarg($config->youtubedl).
' '.$config->params
);
if (isset($format)) {
$cmd .= ' -f '.escapeshellarg($format);
}
@ -114,7 +128,10 @@ Class VideoDownload
static function getURL($url, $format=null)
{
$config = Config::getInstance();
$cmd=$config->python.' '.$config->youtubedl.' '.$config->params;
$cmd = escapeshellcmd(
$config->python.' '.escapeshellarg($config->youtubedl).
' '.$config->params
);
if (isset($format)) {
$cmd .= ' -f '.escapeshellarg($format);
}

View file

@ -1,68 +1,71 @@
{
"name": "rudloff/alltube",
"description": "HTML GUI for youtube-dl",
"license": "GPL-3.0",
"homepage": "http://alltubedownload.net/",
"type": "project",
"require": {
"smarty/smarty": "~3.1",
"rg3/youtube-dl": "2015.12.29",
"slim/slim": "~2.6.2",
"slim/views": "~0.1.3",
"rudloff/smarty-plugin-noscheme": "~0.1.0",
"symfony/yaml": "~3.0.0",
"ffmpeg/ffmpeg": "~2.8.2"
},
"require-dev": {
"symfony/var-dumper": "~3.0.0"
},
"extra": {
"paas": {
"nginx-includes": [
"nginx.conf"
]
}
},
"repositories": [
{
"type": "package",
"package": {
"name": "rg3/youtube-dl",
"version": "2015.12.29",
"source": {
"url": "https://github.com/rg3/youtube-dl.git",
"type": "git",
"reference": "2015.12.29"
}
}
},
{
"type": "package",
"package": {
"name": "ffmpeg/ffmpeg",
"version": "2.8.2",
"dist": {
"url": "http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz",
"type": "xz"
},
"bin": [
"ffmpeg"
]
}
}
],
"authors": [
{
"name": "Pierre Rudloff",
"email": "contact@rudloff.pro",
"homepage": "https://rudloff.pro/",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"Alltube\\": "classes/",
"Alltube\\Controller\\": "controllers/"
}
}
"name": "rudloff/alltube",
"description": "HTML GUI for youtube-dl",
"license": "GPL-3.0",
"homepage": "http://alltubedownload.net/",
"type": "project",
"require": {
"smarty/smarty": "~3.1.29",
"rg3/youtube-dl": "2016.03.14",
"slim/slim": "~2.6.2",
"slim/views": "~0.1.3",
"rudloff/smarty-plugin-noscheme": "~0.1.0",
"symfony/yaml": "~3.0.0",
"ffmpeg/ffmpeg": "~2.8.2"
},
"require-dev": {
"symfony/var-dumper": "~3.0.0"
},
"extra": {
"paas": {
"nginx-includes": [
"nginx.conf"
]
}
},
"repositories": [{
"type": "package",
"package": {
"name": "rg3/youtube-dl",
"version": "2016.03.14",
"source": {
"url": "https://github.com/rg3/youtube-dl.git",
"type": "git",
"reference": "2016.03.14"
}
}
}, {
"type": "package",
"package": {
"name": "ffmpeg/ffmpeg",
"version": "2.8.4",
"dist": {
"url": "http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz",
"type": "xz"
},
"bin": [
"ffmpeg"
]
}
}],
"authors": [{
"name": "Pierre Rudloff",
"email": "contact@rudloff.pro",
"homepage": "https://rudloff.pro/",
"role": "Developer"
}, {
"name": "Olivier Haquette",
"email": "contact@olivierhaquette.fr",
"homepage": "http://olivierhaquette.fr/",
"role": "Designer"
}],
"autoload": {
"psr-4": {
"Alltube\\": "classes/",
"Alltube\\Controller\\": "controllers/"
}
},
"config": {
"secure-http": false
}
}

57
composer.lock generated
View file

@ -4,12 +4,12 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "4ab91a81eeb4af64b1c2385f00c96135",
"content-hash": "e9a52d9ff3660f110122e1ab8b784bba",
"hash": "d4b9e76dbda3af97316a38bfe163ac00",
"content-hash": "6eb27104cc39af34f798d35fb3f381ac",
"packages": [
{
"name": "ffmpeg/ffmpeg",
"version": "2.8.2",
"version": "2.8.4",
"dist": {
"type": "xz",
"url": "http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz",
@ -85,16 +85,16 @@
},
{
"name": "league/uri",
"version": "4.0.1",
"version": "4.1.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri.git",
"reference": "671150fbd1d4120746195d6bec1aa78b95b14104"
"reference": "a4f0ea3323745214c955af2f6451d7743f30a076"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri/zipball/671150fbd1d4120746195d6bec1aa78b95b14104",
"reference": "671150fbd1d4120746195d6bec1aa78b95b14104",
"url": "https://api.github.com/repos/thephpleague/uri/zipball/a4f0ea3323745214c955af2f6451d7743f30a076",
"reference": "a4f0ea3323745214c955af2f6451d7743f30a076",
"shasum": ""
},
"require": {
@ -112,7 +112,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.0-dev"
"dev-master": "4.1-dev"
}
},
"autoload": {
@ -128,8 +128,7 @@
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://github.com/nyamsprod/",
"role": "Developer"
"homepage": "https://nyamsprod.com"
}
],
"description": "URI manipulation library",
@ -146,7 +145,7 @@
"url",
"ws"
],
"time": "2015-11-03 07:54:30"
"time": "2016-02-18 14:46:01"
},
{
"name": "psr/http-message",
@ -199,11 +198,11 @@
},
{
"name": "rg3/youtube-dl",
"version": "2015.12.29",
"version": "2016.03.14",
"source": {
"type": "git",
"url": "https://github.com/rg3/youtube-dl.git",
"reference": "2015.12.29"
"reference": "2016.03.14"
},
"type": "library"
},
@ -399,16 +398,16 @@
},
{
"name": "symfony/yaml",
"version": "v3.0.1",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "3df409958a646dad2bc5046c3fb671ee24a1a691"
"reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/3df409958a646dad2bc5046c3fb671ee24a1a691",
"reference": "3df409958a646dad2bc5046c3fb671ee24a1a691",
"url": "https://api.github.com/repos/symfony/yaml/zipball/b5ba64cd67ecd6887f63868fa781ca094bd1377c",
"reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c",
"shasum": ""
},
"require": {
@ -444,22 +443,22 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2015-12-26 13:39:53"
"time": "2016-02-23 15:16:06"
}
],
"packages-dev": [
{
"name": "symfony/polyfill-mbstring",
"version": "v1.0.1",
"version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25"
"reference": "1289d16209491b584839022f29257ad859b8532d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/49ff736bd5d41f45240cec77b44967d76e0c3d25",
"reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d",
"reference": "1289d16209491b584839022f29257ad859b8532d",
"shasum": ""
},
"require": {
@ -471,7 +470,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "1.1-dev"
}
},
"autoload": {
@ -505,20 +504,20 @@
"portable",
"shim"
],
"time": "2015-11-20 09:19:13"
"time": "2016-01-20 09:13:37"
},
{
"name": "symfony/var-dumper",
"version": "v3.0.1",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "87db8700deb12ba2b65e858f656a1f885530bcb0"
"reference": "9a6a883c48acb215d4825ce9de61dccf93d62074"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/87db8700deb12ba2b65e858f656a1f885530bcb0",
"reference": "87db8700deb12ba2b65e858f656a1f885530bcb0",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/9a6a883c48acb215d4825ce9de61dccf93d62074",
"reference": "9a6a883c48acb215d4825ce9de61dccf93d62074",
"shasum": ""
},
"require": {
@ -568,7 +567,7 @@
"debug",
"dump"
],
"time": "2015-12-05 11:13:14"
"time": "2016-02-13 09:23:44"
}
],
"aliases": [],

Binary file not shown.

View file

@ -1,5 +1,6 @@
youtubedl: vendor/rg3/youtube-dl/youtube_dl/__main__.py
python: /usr/bin/python
params: --no-playlist --no-warnings -f best
curl_params:
convert: false
avconv: vendor/bin/ffmpeg

View file

@ -29,6 +29,7 @@ class FrontController
/**
* Display index page
*
* @return void
*/
static function index()
@ -55,6 +56,7 @@ class FrontController
/**
* Display a list of extractors
*
* @return void
*/
static function extractors()
@ -79,6 +81,7 @@ class FrontController
/**
* Dislay information about the video
*
* @return void
*/
static function video()
@ -130,7 +133,8 @@ class FrontController
);
header("Content-Type: audio/mpeg");
passthru(
'curl --user-agent '.escapeshellarg($UA).
'curl '.$config->curl_params.
' --user-agent '.escapeshellarg($UA).
' '.escapeshellarg($video->url).
' | '.$config->avconv.
' -v quiet -i - -f mp3 -vn pipe:1'
@ -180,6 +184,7 @@ class FrontController
/**
* Redirect to video file
*
* @return void
*/
static function redirect()
@ -198,6 +203,7 @@ class FrontController
/**
* Output JSON info about the video
*
* @return void
*/
static function json()

29
manifest.json Normal file
View file

@ -0,0 +1,29 @@
{
"short_name": "AllTube",
"name": "AllTube Download",
"display": "minimal-ui",
"icons": [{
"src": "img/favicon.png",
"sizes": "32x32",
"type": "image/png"
}, {
"src": "img/logo_60.png",
"sizes": "60x60",
"type": "image/png"
}, {
"src": "img/logo_90.png",
"sizes": "90x60",
"type": "image/png"
}, {
"src": "img/logo_app.png",
"sizes": "243x243",
"type": "image/png"
}, {
"src": "img/logo_250.png",
"sizes": "250x250",
"type": "image/png"
}],
"lang": "en",
"start_url": "./index.php",
"theme_color": "#4F4F4F"
}

View file

@ -1,21 +1,18 @@
{
"name": "alltube",
"version": "0.4.4",
"version": "0.4.5",
"license": "GPL-3.0",
"dependencies": {
"grunt": "~0.4.5",
"grunt-cli": "~0.1.13",
"grunt-contrib-cssmin": "~0.14.0",
"grunt-contrib-uglify": "~0.11.0",
"grunt-contrib-cssmin": "~1.0.0",
"grunt-contrib-uglify": "~1.0.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-phpcs": "~0.4.0",
"grunt-phpunit": "~0.3.6",
"grunt-contrib-compress": "~0.14.0",
"grunt-contrib-compress": "~1.1.1",
"bower": "~1.7.1"
},
"engines": {
"node": "~0.10.29"
},
"repository": {
"type": "git",
"url": "https://github.com/Rudloff/alltube.git"

View file

@ -4,27 +4,29 @@
<meta charset="UTF-8" />
<meta name=viewport content="width=device-width, initial-scale=1">
<meta name="description" content="Easily download videos from Youtube, Dailymotion, Vimeo and other websites." />
<link rel="stylesheet" href="{siteUrl|noscheme url='dist/main.css'}" />
<link rel="stylesheet" href="{siteUrl|noscheme|replace:'index.php':'' url='dist/main.css'}" />
<link rel="author" href="https://plus.google.com/110403274854419000481?rel=author" />
<link rel="author" href="https://plus.google.com/103696815796116179392?rel=author" />
<link href="https://plus.google.com/108799967445657477255" rel="publisher" />
<title itemprop="name">AllTube Download</title>
<meta itemprop="url" content="{siteUrl}" />
<link rel="canonical" href="{currentUrl|replace:{siteUrl}:'http://www.alltubedownload.net/'}" />
<link rel="icon" href="{siteUrl|noscheme url='img/favicon.png'}" />
<link rel="icon" href="{siteUrl|noscheme|replace:'index.php':'' url='img/favicon.png'}" />
<meta property="og:url" content="{siteUrl}" />
<meta property="og:title" content="AllTube Download" />
<meta property="og:description" content="Easily download videos from Youtube, Dailymotion, Vimeo and other websites." />
<meta property="og:image" content="{siteUrl url='img/logo.png'}" />
<meta property="og:image" content="{siteUrl|replace:'index.php':'' url='img/logo.png'}" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="AllTube Download" />
<meta name="twitter:image" content="{siteUrl url='img/logo.png'}" />
<meta name="twitter:image" content="{siteUrl|replace:'index.php':'' url='img/logo.png'}" />
<meta name="twitter:creator" content="@Tael67" />
<meta name="twitter:description" content="Easily download videos from Youtube, Dailymotion, Vimeo and other websites." />
<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"></script>
<script src="{siteUrl|noscheme url='dist/main.js'}"></script>
<script src="{siteUrl|noscheme|replace:'index.php':'' url='dist/main.js'}"></script>
<meta itemprop="applicationCategory" content="Download" />
<meta itemprop="operatingSystem" content="Linux" />
<meta itemprop="operatingSystem" content="Mac OS X" />
<meta name="theme-color" content="#4F4F4F">
<link rel="manifest" href="manifest.json" />
</head>
<body class="{$class}">

View file

@ -1,5 +1,5 @@
<div class="main">
<div><img itemprop="image" class="logo" src="{siteUrl|noscheme url='img/logo.png'}"
<div><img itemprop="image" class="logo" src="{siteUrl|noscheme|replace:'index.php':'' url='img/logo.png'}"
alt="AllTube Download" width="328" height="284"></div>
<form action="{urlFor name="video"}">
<label class="labelurl" for="url">

View file

@ -1,4 +1,4 @@
<h1 class="logobis">
<a class="logocompatible" href="{siteUrl}">
AllTube Download<span class="logocompatiblemask"><img src="{siteUrl|noscheme url='img/logocompatiblemask.png'}" width="447" height="107" alt="" /></span>
AllTube Download<span class="logocompatiblemask"><img src="{siteUrl|noscheme|replace:'index.php':'' url='img/logocompatiblemask.png'}" width="447" height="107" alt="" /></span>
</a></h1>

View file

@ -9,13 +9,13 @@
href="{$video->webpage_url}">
{$video->title}</a></i>.
<img class="cast_icon" id="cast_disabled"
src="{siteUrl|noscheme url='img/ic_media_route_disabled_holo_light.png'}"
src="{siteUrl|noscheme|replace:'index.php':'' url='img/ic_media_route_disabled_holo_light.png'}"
alt="Google Cast™ is disabled"
title="Google Cast is not supported on this browser." />
<img class="cast_btn cast_hidden cast_icon" id="cast_btn_launch"
src="{siteUrl|noscheme url='img/ic_media_route_off_holo_light.png'}"
src="{siteUrl|noscheme|replace:'index.php':'' url='img/ic_media_route_off_holo_light.png'}"
title="Cast to ChromeCast" alt="Google Cast™" />
<img src="{siteUrl|noscheme url='img/ic_media_route_on_holo_light.png'}"
<img src="{siteUrl|noscheme|replace:'index.php':'' url='img/ic_media_route_on_holo_light.png'}"
alt="Casting to ChromeCast…" title="Stop casting"
id="cast_btn_stop" class="cast_btn cast_hidden cast_icon" /></p>
{if isset($video->thumbnail)}

View file

@ -28,6 +28,7 @@ class ConfigTest extends PHPUnit_Framework_TestCase
/**
* Test the getInstance function
*
* @return void
*/
public function testGetInstance()