Using native yt-dlp on Linux instead of the wrapper one
This commit is contained in:
parent
0df4b3f387
commit
76683d8381
2 changed files with 15 additions and 4 deletions
|
@ -7,14 +7,16 @@ 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();
|
||||
return ytDlpPaths[platform] || ytDlpPaths.linux;
|
||||
if (platform === 'linux') {
|
||||
return 'yt-dlp';
|
||||
}l
|
||||
return ytDlpPaths[platform] || 'yt-dlp';
|
||||
};
|
||||
|
||||
async function downloadFromYoutube(command, args) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue