use built-in yt-dlp by default

This commit is contained in:
huangjx
2022-05-20 16:14:27 +08:00
parent ac4aaa0c07
commit dacb8af7ae

View File

@@ -1,4 +1,5 @@
<?php <?php
namespace OCA\NCDownloader\Tools; namespace OCA\NCDownloader\Tools;
use OCA\NCDownloader\Tools\Helper; use OCA\NCDownloader\Tools\Helper;
@@ -31,7 +32,7 @@ class Youtube
if (isset($binary) && $this->isExecutable($binary)) { if (isset($binary) && $this->isExecutable($binary)) {
$this->bin = $binary; $this->bin = $binary;
} else { } else {
$this->bin = Helper::findBinaryPath('youtube-dl', __DIR__ . "/../../bin/yt-dlp"); $this->bin = __DIR__ . "/../../bin/yt-dlp"; //Helper::findBinaryPath('youtube-dl', __DIR__ . "/../../bin/yt-dlp");
} }
if ($this->isInstalled() && !$this->isExecutable()) { if ($this->isInstalled() && !$this->isExecutable()) {
chmod($this->bin, 0744); chmod($this->bin, 0744);
@@ -226,7 +227,6 @@ class Youtube
foreach ($this->options as $option) { foreach ($this->options as $option) {
$this->cmd .= " " . $option; $this->cmd .= " " . $option;
} }
} }
public function isInstalled() public function isInstalled()
{ {
@@ -263,5 +263,4 @@ class Youtube
{ {
return "https://github.com/shiningw/ncdownloader-bin/raw/master/yt-dlp"; return "https://github.com/shiningw/ncdownloader-bin/raw/master/yt-dlp";
} }
} }