added executable permissions if youtube-dl or aria2c doesn't have it

This commit is contained in:
huangjx
2022-02-22 17:59:25 +08:00
parent 2efdd2ddfb
commit 324ddf616a
2 changed files with 6 additions and 0 deletions

View File

@@ -43,6 +43,9 @@ class Aria2
} else {
$this->bin = Helper::findBinaryPath('aria2c', __DIR__ . "/../../bin/aria2c");
}
if ($this->isInstalled() && !$this->isExecutable()) {
chmod($this->bin, 755);
}
$this->setDownloadDir($dir);
$this->setTorrentsDir($torrents_dir);
if (!empty($settings)) {

View File

@@ -33,6 +33,9 @@ class Youtube
} else {
$this->bin = Helper::findBinaryPath('youtube-dl', __DIR__ . "/../../bin/youtube-dl");
}
if ($this->isInstalled() && !$this->isExecutable()) {
chmod($this->bin, 755);
}
$this->setDownloadDir($downloadDir);
if (!empty($settings)) {
foreach ($settings as $key => $value) {