From 324ddf616ae126edf65cb7bf89663ed7bb302092 Mon Sep 17 00:00:00 2001 From: huangjx Date: Tue, 22 Feb 2022 17:59:25 +0800 Subject: [PATCH] added executable permissions if youtube-dl or aria2c doesn't have it --- lib/Tools/Aria2.php | 3 +++ lib/Tools/Youtube.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lib/Tools/Aria2.php b/lib/Tools/Aria2.php index 1218c70..2801a9d 100644 --- a/lib/Tools/Aria2.php +++ b/lib/Tools/Aria2.php @@ -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)) { diff --git a/lib/Tools/Youtube.php b/lib/Tools/Youtube.php index eb517c1..174968f 100644 --- a/lib/Tools/Youtube.php +++ b/lib/Tools/Youtube.php @@ -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) {