fixed bugs introduced in a5c3785ed8d6a35868bc169f07e40e889087fd2e
This commit is contained in:
@@ -37,13 +37,17 @@ class Aria2
|
|||||||
);
|
);
|
||||||
//turn keys in $options into variables
|
//turn keys in $options into variables
|
||||||
extract($options);
|
extract($options);
|
||||||
|
if (isset($binary) && @is_executable($binary)) {
|
||||||
|
$this->bin = $binary;
|
||||||
|
} else {
|
||||||
|
$this->bin = Helper::findBinaryPath('aria2c');
|
||||||
|
}
|
||||||
$this->setDownloadDir($dir);
|
$this->setDownloadDir($dir);
|
||||||
if (!empty($settings)) {
|
if (!empty($settings)) {
|
||||||
foreach ($settings as $key => $value) {
|
foreach ($settings as $key => $value) {
|
||||||
$this->setOption($key, $value);
|
$this->setOption($key, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->bin = Helper::findBinaryPath('aria2c');
|
|
||||||
$this->php = Helper::findBinaryPath('php');
|
$this->php = Helper::findBinaryPath('php');
|
||||||
$this->completeHook = $completeHook;
|
$this->completeHook = $completeHook;
|
||||||
$this->rpcUrl = sprintf("http://%s:%s/jsonrpc", $host, $port);
|
$this->rpcUrl = sprintf("http://%s:%s/jsonrpc", $host, $port);
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Youtube
|
|||||||
private $format = 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best';
|
private $format = 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best';
|
||||||
private $options = [];
|
private $options = [];
|
||||||
private $downloadDir;
|
private $downloadDir;
|
||||||
private $timeout = 60 * 60 * 3;//3 hours
|
private $timeout = 60 * 60 * 3; //3 hours
|
||||||
private $outTpl = "/%(id)s-%(title)s.%(ext)s";
|
private $outTpl = "/%(id)s-%(title)s.%(ext)s";
|
||||||
private $defaultDir = "/tmp/downloads";
|
private $defaultDir = "/tmp/downloads";
|
||||||
private $env = [];
|
private $env = [];
|
||||||
@@ -26,8 +26,13 @@ class Youtube
|
|||||||
}
|
}
|
||||||
public function init(array $options)
|
public function init(array $options)
|
||||||
{
|
{
|
||||||
$this->bin = Helper::findBinaryPath('youtube-dl');
|
|
||||||
extract($options);
|
extract($options);
|
||||||
|
if (isset($binary) && @is_executable($binary)) {
|
||||||
|
$this->bin = $binary;
|
||||||
|
} else {
|
||||||
|
$this->bin = Helper::findBinaryPath('youtube-dl');
|
||||||
|
}
|
||||||
|
|
||||||
$this->setDownloadDir($downloadDir);
|
$this->setDownloadDir($downloadDir);
|
||||||
if (!empty($settings)) {
|
if (!empty($settings)) {
|
||||||
foreach ($settings as $key => $value) {
|
foreach ($settings as $key => $value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user