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:
@@ -26,8 +26,8 @@
|
|||||||
"x86_64-unknown-linux-gnu": {
|
"x86_64-unknown-linux-gnu": {
|
||||||
"yt-dlp": {
|
"yt-dlp": {
|
||||||
"version": "2026.06.09",
|
"version": "2026.06.09",
|
||||||
"url": "https://github.com/yt-dlp/yt-dlp/releases/download/2026.06.09/yt-dlp_linux",
|
"url": "https://github.com/yt-dlp/yt-dlp/releases/download/2026.06.09/yt-dlp_linux.zip",
|
||||||
"sha256": "bf8aac79b72287a6d2043074415132558b43743a8f9461a22b0141e90f16ce66"
|
"sha256": "217bbc9c3ed19ea75a7f151a3e48dbfeac7f459a7dce2deeeecc2d6e2871bd5b"
|
||||||
},
|
},
|
||||||
"deno": {
|
"deno": {
|
||||||
"version": "2.9.0",
|
"version": "2.9.0",
|
||||||
|
|||||||
@@ -38,11 +38,10 @@ const executableSuffix = isWindows ? '.exe' : '';
|
|||||||
|
|
||||||
async function download(name, source) {
|
async function download(name, source) {
|
||||||
const sourcePath = new URL(source.url).pathname;
|
const sourcePath = new URL(source.url).pathname;
|
||||||
let ext = '';
|
const archive = path.join(
|
||||||
if (sourcePath.endsWith('.tar.xz')) ext = '.tar.xz';
|
temporary,
|
||||||
else if (sourcePath.endsWith('.zip')) ext = '.zip';
|
`${name}${sourcePath.endsWith('.tar.xz') ? '.tar.xz' : '.zip'}`
|
||||||
|
);
|
||||||
const archive = path.join(temporary, `${name}${ext}`);
|
|
||||||
const response = await fetch(source.url, { redirect: 'follow' });
|
const response = await fetch(source.url, { redirect: 'follow' });
|
||||||
if (!response.ok || !response.body) {
|
if (!response.ok || !response.body) {
|
||||||
throw new Error(`Failed to download ${name}: HTTP ${response.status}`);
|
throw new Error(`Failed to download ${name}: HTTP ${response.status}`);
|
||||||
@@ -66,12 +65,8 @@ async function download(name, source) {
|
|||||||
fs.mkdirSync(extracted);
|
fs.mkdirSync(extracted);
|
||||||
if (archive.endsWith('.zip') && process.platform !== 'win32') {
|
if (archive.endsWith('.zip') && process.platform !== 'win32') {
|
||||||
execFileSync('unzip', ['-q', archive, '-d', extracted], { stdio: 'inherit' });
|
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 {
|
} else {
|
||||||
const finalPath = path.join(extracted, `${name}${executableSuffix}`);
|
execFileSync('tar', ['-xf', archive, '-C', extracted], { stdio: 'inherit' });
|
||||||
fs.copyFileSync(archive, finalPath);
|
|
||||||
fs.chmodSync(finalPath, 0o755);
|
|
||||||
}
|
}
|
||||||
return extracted;
|
return extracted;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user