mirror of
https://github.com/nimbold/Firelink.git
synced 2026-07-26 12:08:27 +00:00
Revert "fix(linux): use single-file yt-dlp binary to avoid linuxdeploy crashes"
This reverts commit f2f9da1489.
This commit is contained in:
@@ -38,11 +38,10 @@ const executableSuffix = isWindows ? '.exe' : '';
|
||||
|
||||
async function download(name, source) {
|
||||
const sourcePath = new URL(source.url).pathname;
|
||||
let ext = '';
|
||||
if (sourcePath.endsWith('.tar.xz')) ext = '.tar.xz';
|
||||
else if (sourcePath.endsWith('.zip')) ext = '.zip';
|
||||
|
||||
const archive = path.join(temporary, `${name}${ext}`);
|
||||
const archive = path.join(
|
||||
temporary,
|
||||
`${name}${sourcePath.endsWith('.tar.xz') ? '.tar.xz' : '.zip'}`
|
||||
);
|
||||
const response = await fetch(source.url, { redirect: 'follow' });
|
||||
if (!response.ok || !response.body) {
|
||||
throw new Error(`Failed to download ${name}: HTTP ${response.status}`);
|
||||
@@ -66,12 +65,8 @@ async function download(name, source) {
|
||||
fs.mkdirSync(extracted);
|
||||
if (archive.endsWith('.zip') && process.platform !== 'win32') {
|
||||
execFileSync('unzip', ['-q', archive, '-d', extracted], { stdio: 'inherit' });
|
||||
} else if (archive.endsWith('.zip') || archive.endsWith('.tar.xz')) {
|
||||
execFileSync('tar', ['-xf', archive, '-C', extracted], { stdio: 'inherit' });
|
||||
} else {
|
||||
const finalPath = path.join(extracted, `${name}${executableSuffix}`);
|
||||
fs.copyFileSync(archive, finalPath);
|
||||
fs.chmodSync(finalPath, 0o755);
|
||||
execFileSync('tar', ['-xf', archive, '-C', extracted], { stdio: 'inherit' });
|
||||
}
|
||||
return extracted;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user