From 05b144cb7b293cd6e61dcd3b762b20cf7025b835 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 29 Oct 2015 19:02:19 +0100 Subject: [PATCH] Download youtube-dl with composer (fixes #35) --- composer.json | 18 +++++++++++- composer.lock | 71 ++++++++++++++++++++++++++++++++++++++++++++-- config.example.php | 2 +- download.php | 2 +- package.json | 2 +- 5 files changed, 89 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 2f4b7d2..5ab188e 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,9 @@ "homepage": "http://alltubedownload.net/", "type": "project", "require": { - "smarty/smarty": "~3.1" + "smarty/smarty": "~3.1", + "rg3/youtube-dl": "2015.10.24", + "symfony/var-dumper": "~2.7.6" }, "extra": { "paas": { @@ -14,6 +16,20 @@ ] } }, + "repositories": [ + { + "type": "package", + "package": { + "name": "rg3/youtube-dl", + "version": "2015.10.24", + "source": { + "url": "https://github.com/rg3/youtube-dl.git", + "type": "git", + "reference": "2015.10.24" + } + } + } + ], "authors": [ { "name": "Pierre Rudloff", diff --git a/composer.lock b/composer.lock index 6fb1c3a..92c8f15 100644 --- a/composer.lock +++ b/composer.lock @@ -1,11 +1,22 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "1d95265fc34ff6df149985554a8ba0d6", + "hash": "0f26a6f71839164cb9ca3b6905832232", + "content-hash": "34cc3c83cf4cbf26da3aa7c8f15a4b50", "packages": [ + { + "name": "rg3/youtube-dl", + "version": "2015.10.24", + "source": { + "type": "git", + "url": "https://github.com/rg3/youtube-dl.git", + "reference": "2015.10.24" + }, + "type": "library" + }, { "name": "smarty/smarty", "version": "v3.1.27", @@ -60,6 +71,62 @@ "templating" ], "time": "2015-06-18 00:55:59" + }, + { + "name": "symfony/var-dumper", + "version": "v2.7.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "eb033050050916b6bfa51be71009ef67b16046c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/eb033050050916b6bfa51be71009ef67b16046c9", + "reference": "eb033050050916b6bfa51be71009ef67b16046c9", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "suggest": { + "ext-symfony_debug": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2015-10-25 17:17:38" } ], "packages-dev": [], diff --git a/config.example.php b/config.example.php index f410318..8b71239 100644 --- a/config.example.php +++ b/config.example.php @@ -11,7 +11,7 @@ * @license GNU General Public License http://www.gnu.org/licenses/gpl.html * @link http://rudloff.pro * */ -define('YOUTUBE_DL', './youtube-dl'); +define('YOUTUBE_DL', __DIR__.'/vendor/rg3/youtube-dl/youtube_dl/__main__.py'); define('PYTHON', '/usr/bin/python'); define('PARAMS', '--no-playlist --no-warnings -f best'); if (getenv('CONVERT')) { diff --git a/download.php b/download.php index 8bcd6de..6c20965 100644 --- a/download.php +++ b/download.php @@ -64,7 +64,7 @@ Class VideoDownload * */ static function getFilename($url, $format=null) { - $cmd=PYTHON.' youtube-dl'; + $cmd=PYTHON.' '.YOUTUBE_DL; if (isset($format)) { $cmd .= ' -f '.escapeshellarg($format); } diff --git a/package.json b/package.json index bf94bc7..af3b7d6 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,6 @@ "url": "https://github.com/Rudloff/alltube.git" }, "scripts": { - "postinstall": "./node_modules/grunt-cli/bin/grunt; curl -L https://yt-dl.org/downloads/latest/youtube-dl -o youtube-dl; curl http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz -o ffmpeg.tar.xz; tar xJf ffmpeg.tar.xz -C ffmpeg --strip-components=1" + "postinstall": "./node_modules/grunt-cli/bin/grunt; curl http://johnvansickle.com/ffmpeg/releases/ffmpeg-release-64bit-static.tar.xz -o ffmpeg.tar.xz; tar xJf ffmpeg.tar.xz -C ffmpeg --strip-components=1" } }