Using downloaded executable on Linux too

This commit is contained in:
Lucas Gabriel 2024-09-29 23:16:27 -03:00
parent d5ab223f13
commit 2f7184fddd
No known key found for this signature in database
GPG Key ID: D9B075FC6DC93985

View File

@ -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) => {