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:
parent
4b1db952ba
commit
e36e98e47a
6 changed files with 23 additions and 8 deletions
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
6
composer.lock
generated
6
composer.lock
generated
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue