fixed the issue of not returning the default provided value when finding binary path
This commit is contained in:
@@ -81,7 +81,7 @@ class YoutubeController extends Controller
|
|||||||
$yt = $this->youtube;
|
$yt = $this->youtube;
|
||||||
$yt->audioOnly = (bool) $this->request->getParam('audio-only');
|
$yt->audioOnly = (bool) $this->request->getParam('audio-only');
|
||||||
if (!$yt->isInstalled()) {
|
if (!$yt->isInstalled()) {
|
||||||
return new JSONResponse(["error" => "Youtube-dl is not installed!"]);
|
return new JSONResponse(["error" => "Please install the latest youtube-dl or make the bundled binary file executable in ncdownloader/bin"]);
|
||||||
}
|
}
|
||||||
if (Helper::isGetUrlSite($url)) {
|
if (Helper::isGetUrlSite($url)) {
|
||||||
return new JSONResponse($this->downloadUrlSite($url));
|
return new JSONResponse($this->downloadUrlSite($url));
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ class Helper
|
|||||||
}
|
}
|
||||||
$dataPath = \OC::$server->getSystemConfig()->getValue('datadirectory');
|
$dataPath = \OC::$server->getSystemConfig()->getValue('datadirectory');
|
||||||
$paths = ['/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/opt/bin', $dataPath . "/bin"];
|
$paths = ['/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/opt/bin', $dataPath . "/bin"];
|
||||||
$result = null;
|
$result = $default;
|
||||||
$exeSniffer = new ExecutableFinder();
|
$exeSniffer = new ExecutableFinder();
|
||||||
// Returns null if nothing is found
|
// Returns null if nothing is found
|
||||||
$result = $exeSniffer->find($program, $default, $paths);
|
$result = $exeSniffer->find($program, $default, $paths);
|
||||||
|
|||||||
Reference in New Issue
Block a user