feat: New phantomjsDir option

This is used by the openload extractor

We also add to update youtube-dl to 2018.01.21 in order for the extractor to work correctly.
Fixes #146
This commit is contained in:
Pierre Rudloff 2018-01-25 15:10:11 +01:00
parent 4b1db952ba
commit e36e98e47a
6 changed files with 23 additions and 8 deletions

View file

@ -68,6 +68,12 @@ class Config
*/ */
public $avconv = 'vendor/bin/ffmpeg'; public $avconv = 'vendor/bin/ffmpeg';
/**
* Path to the directory that contains the phantomjs binary.
* @var string
*/
public $phantomjsDir = 'vendor/bin/';
/** /**
* Disable URL rewriting. * Disable URL rewriting.
* *

View file

@ -99,7 +99,7 @@ class VideoDownload
$process = $this->getProcess($arguments); $process = $this->getProcess($arguments);
//This is needed by the openload extractor because it runs PhantomJS //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->inheritEnvironmentVariables();
$process->run(); $process->run();
if (!$process->isSuccessful()) { if (!$process->isSuccessful()) {

View file

@ -23,7 +23,7 @@
"phpunit/phpunit": "~6.5.2", "phpunit/phpunit": "~6.5.2",
"doctrine/instantiator": "~1.0.0", "doctrine/instantiator": "~1.0.0",
"ffmpeg/ffmpeg": "~3.4.1", "ffmpeg/ffmpeg": "~3.4.1",
"rg3/youtube-dl": "2017.12.10", "rg3/youtube-dl": "2018.01.21",
"heroku/heroku-buildpack-php": "*", "heroku/heroku-buildpack-php": "*",
"anam/phantomjs-linux-x86-binary": "~2.1.1" "anam/phantomjs-linux-x86-binary": "~2.1.1"
}, },
@ -39,10 +39,10 @@
"type": "package", "type": "package",
"package": { "package": {
"name": "rg3/youtube-dl", "name": "rg3/youtube-dl",
"version": "2017.12.10", "version": "2018.01.21",
"dist": { "dist": {
"type": "zip", "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"
} }
} }
}, },

6
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://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" "This file is @generated automatically"
], ],
"content-hash": "9ba64783ab353b1a590a744bb06065b0", "content-hash": "4252f8c5d568e5b9854a84da162e621c",
"packages": [ "packages": [
{ {
"name": "aura/session", "name": "aura/session",
@ -2156,10 +2156,10 @@
}, },
{ {
"name": "rg3/youtube-dl", "name": "rg3/youtube-dl",
"version": "2017.12.10", "version": "2018.01.21",
"dist": { "dist": {
"type": "zip", "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, "reference": null,
"shasum": null "shasum": null
}, },

View file

@ -27,6 +27,9 @@ avconv: vendor/bin/ffmpeg
# avconv/ffmpeg logging level. # avconv/ffmpeg logging level.
avconvVerbosity: error avconvVerbosity: error
# Path to the directory that contains the phantomjs binary.
phantomjsDir: vendor/bin/
# True to disable URL rewriting # True to disable URL rewriting
uglyUrls: false uglyUrls: false

View file

@ -197,6 +197,12 @@ class VideoDownloadTest extends TestCase
'f4v', 'f4v',
'edgefcs.net', '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('ext', $info);
$this->assertObjectHasAttribute('title', $info); $this->assertObjectHasAttribute('title', $info);
$this->assertObjectHasAttribute('extractor_key', $info); $this->assertObjectHasAttribute('extractor_key', $info);
$this->assertObjectHasAttribute('formats', $info); $this->assertObjectHasAttribute('format', $info);
} }
/** /**