From f4495794fe4c1af3afe6eb3ced45c494154a4f75 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 16 May 2015 03:23:55 +0200 Subject: [PATCH] ffmpeg --- .gitignore | 2 ++ api.php | 4 ++-- config.example.php | 7 ++++++- package.json | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 7e9681b..684f1aa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ node_modules/ config.php vendor/ templates_c/ +ffmpeg.tar.xz +ffmpeg-2.6.2-64bit-static/ diff --git a/api.php b/api.php index ecdc260..3a7fdf0 100644 --- a/api.php +++ b/api.php @@ -39,7 +39,7 @@ if (isset($_GET["url"])) { header("Content-Type: audio/mpeg"); passthru( '/usr/bin/rtmpdump -q -r '.escapeshellarg($video->url). - ' | /usr/bin/avconv -v quiet -i - -f mp3 -vn pipe:1' + ' | '.AVCONV.' -v quiet -i - -f mp3 -vn pipe:1' ); exit; } else { @@ -57,7 +57,7 @@ if (isset($_GET["url"])) { passthru( '/usr/bin/wget -q --user-agent='.escapeshellarg($UA). ' -O - '.escapeshellarg($video->url). - ' | /usr/bin/avconv -v quiet -i - -f mp3 -vn pipe:1' + ' | '.AVCONV.' -v quiet -i - -f mp3 -vn pipe:1' ); exit; } diff --git a/config.example.php b/config.example.php index 3858896..6bfd314 100644 --- a/config.example.php +++ b/config.example.php @@ -14,7 +14,12 @@ define('YOUTUBE_DL', './youtube-dl'); define('PYTHON', '/usr/bin/python'); define('PARAMS', '--no-playlist --no-warnings'); -define('CONVERT', false); +if (getenv('CONVERT')) { + define('CONVERT', getenv('CONVERT')); +} else { + define('CONVERT', false); +} +define('AVCONV', __DIR__.'/ffmpeg-2.6.2-64bit-static/ffmpeg'); define('MAINTENANCE', false); define('DISABLED', false); define('BASE_URL', 'http://alltubedownload.net/'); diff --git a/package.json b/package.json index 475f84d..06fc75d 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,6 @@ "url": "https://github.com/Rudloff/alltube.git" }, "scripts": { - "postinstall": "./node_modules/grunt-cli/bin/grunt; curl https://yt-dl.org/downloads/2015.04.09/youtube-dl -o youtube-dl" + "postinstall": "./node_modules/grunt-cli/bin/grunt; curl https://yt-dl.org/downloads/2015.04.09/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" } }