From dacb8af7ae9d1810fa4c5cfcd3aa9a909f08fb59 Mon Sep 17 00:00:00 2001 From: huangjx Date: Fri, 20 May 2022 16:14:27 +0800 Subject: [PATCH] use built-in yt-dlp by default --- lib/Tools/Youtube.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Tools/Youtube.php b/lib/Tools/Youtube.php index 9f0af04..c9ed466 100644 --- a/lib/Tools/Youtube.php +++ b/lib/Tools/Youtube.php @@ -1,4 +1,5 @@ isExecutable($binary)) { $this->bin = $binary; } 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()) { chmod($this->bin, 0744); @@ -144,7 +145,7 @@ class Youtube $this->prependOption($this->bin); $process = new Process($this->options, null, $this->env); $process->setTimeout($this->timeout); - $data = ['link' => $url,'path' => $this->dbDlPath]; + $data = ['link' => $url, 'path' => $this->dbDlPath]; if ($this->audioOnly) { $data['ext'] = $this->audioFormat; } else { @@ -226,7 +227,6 @@ class Youtube foreach ($this->options as $option) { $this->cmd .= " " . $option; } - } public function isInstalled() { @@ -263,5 +263,4 @@ class Youtube { return "https://github.com/shiningw/ncdownloader-bin/raw/master/yt-dlp"; } - }