From 2f7184fddd0bb78471e46adeab54fabe94f76978 Mon Sep 17 00:00:00 2001 From: Lucas Gabriel Date: Sun, 29 Sep 2024 23:16:27 -0300 Subject: [PATCH] Using downloaded executable on Linux too --- commands/youtube.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/commands/youtube.js b/commands/youtube.js index 71bfd86..f430be7 100644 --- a/commands/youtube.js +++ b/commands/youtube.js @@ -7,17 +7,15 @@ const fs = require('fs'); const path = require('path'); const ytDlpPaths = { + linux: path.resolve(__dirname, '../plugins/yt-dlp/yt-dlp'), win32: path.resolve(__dirname, '../plugins/yt-dlp/yt-dlp.exe'), darwin: path.resolve(__dirname, '../plugins/yt-dlp/yt-dlp_macos'), }; function getYtDlpPath() { const platform = os.platform(); - if (platform === 'linux') { - return 'yt-dlp'; - } - return ytDlpPaths[platform] || 'yt-dlp'; -} + return ytDlpPaths[platform] || ytDlpPaths.linux; +}; async function downloadFromYoutube(command, args) { return new Promise((resolve, reject) => {