diff --git a/classes/Config.php b/classes/Config.php index b68a2c7..daa4253 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -68,6 +68,12 @@ class Config */ public $avconv = 'vendor/bin/ffmpeg'; + /** + * Path to the directory that contains the phantomjs binary. + * @var string + */ + public $phantomjsDir = 'vendor/bin/'; + /** * Disable URL rewriting. * diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 5ac5878..398a6f0 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -99,7 +99,7 @@ class VideoDownload $process = $this->getProcess($arguments); //This is needed by the openload extractor because it runs PhantomJS - $process->setEnv(['QT_QPA_PLATFORM'=>'offscreen']); + $process->setEnv(['QT_QPA_PLATFORM'=>'phantom', 'PATH'=>$this->config->phantomjsDir]); $process->inheritEnvironmentVariables(); $process->run(); if (!$process->isSuccessful()) { diff --git a/composer.json b/composer.json index 90dfb58..fe25f0b 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "phpunit/phpunit": "~6.5.2", "doctrine/instantiator": "~1.0.0", "ffmpeg/ffmpeg": "~3.4.1", - "rg3/youtube-dl": "2017.12.10", + "rg3/youtube-dl": "2018.01.21", "heroku/heroku-buildpack-php": "*", "anam/phantomjs-linux-x86-binary": "~2.1.1" }, @@ -39,10 +39,10 @@ "type": "package", "package": { "name": "rg3/youtube-dl", - "version": "2017.12.10", + "version": "2018.01.21", "dist": { "type": "zip", - "url": "https://github.com/rg3/youtube-dl/archive/2017.12.10.zip" + "url": "https://github.com/rg3/youtube-dl/archive/2018.01.21.zip" } } }, diff --git a/composer.lock b/composer.lock index 4fe118e..c799ce7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "9ba64783ab353b1a590a744bb06065b0", + "content-hash": "4252f8c5d568e5b9854a84da162e621c", "packages": [ { "name": "aura/session", @@ -2156,10 +2156,10 @@ }, { "name": "rg3/youtube-dl", - "version": "2017.12.10", + "version": "2018.01.21", "dist": { "type": "zip", - "url": "https://github.com/rg3/youtube-dl/archive/2017.12.10.zip", + "url": "https://github.com/rg3/youtube-dl/archive/2018.01.21.zip", "reference": null, "shasum": null }, diff --git a/config/config.example.yml b/config/config.example.yml index 9254516..c616db5 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -27,6 +27,9 @@ avconv: vendor/bin/ffmpeg # avconv/ffmpeg logging level. avconvVerbosity: error +# Path to the directory that contains the phantomjs binary. +phantomjsDir: vendor/bin/ + # True to disable URL rewriting uglyUrls: false diff --git a/tests/VideoDownloadTest.php b/tests/VideoDownloadTest.php index 98fec56..098a6c1 100644 --- a/tests/VideoDownloadTest.php +++ b/tests/VideoDownloadTest.php @@ -197,6 +197,12 @@ class VideoDownloadTest extends TestCase 'f4v', 'edgefcs.net', ], + [ + 'https://openload.co/embed/qTsjMEUtN4U', 'best[protocol^=http]', + 'aup-the-lego-ninjago-movie-2017-1508463762.MP4.mp4-qTsjMEUtN4U', + 'mp4', + 'openload.co' + ] ]; } @@ -282,7 +288,7 @@ class VideoDownloadTest extends TestCase $this->assertObjectHasAttribute('ext', $info); $this->assertObjectHasAttribute('title', $info); $this->assertObjectHasAttribute('extractor_key', $info); - $this->assertObjectHasAttribute('formats', $info); + $this->assertObjectHasAttribute('format', $info); } /**