mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
Using downloaded executable on Linux too
This commit is contained in:
parent
d5ab223f13
commit
2f7184fddd
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user