From f2f9da148910e83dc4652c95d20ce4bb5c61d94f Mon Sep 17 00:00:00 2001 From: NimBold Date: Tue, 30 Jun 2026 05:33:13 +0330 Subject: [PATCH] fix(linux): use single-file yt-dlp binary to avoid linuxdeploy crashes --- engine-sources.lock.json | 4 ++-- scripts/provision-engines.js | 15 ++++++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/engine-sources.lock.json b/engine-sources.lock.json index 8a4807a..6d34897 100644 --- a/engine-sources.lock.json +++ b/engine-sources.lock.json @@ -26,8 +26,8 @@ "x86_64-unknown-linux-gnu": { "yt-dlp": { "version": "2026.06.09", - "url": "https://github.com/yt-dlp/yt-dlp/releases/download/2026.06.09/yt-dlp_linux.zip", - "sha256": "217bbc9c3ed19ea75a7f151a3e48dbfeac7f459a7dce2deeeecc2d6e2871bd5b" + "url": "https://github.com/yt-dlp/yt-dlp/releases/download/2026.06.09/yt-dlp_linux", + "sha256": "bf8aac79b72287a6d2043074415132558b43743a8f9461a22b0141e90f16ce66" }, "deno": { "version": "2.9.0", diff --git a/scripts/provision-engines.js b/scripts/provision-engines.js index 1e91222..18dd491 100644 --- a/scripts/provision-engines.js +++ b/scripts/provision-engines.js @@ -38,10 +38,11 @@ const executableSuffix = isWindows ? '.exe' : ''; async function download(name, source) { const sourcePath = new URL(source.url).pathname; - const archive = path.join( - temporary, - `${name}${sourcePath.endsWith('.tar.xz') ? '.tar.xz' : '.zip'}` - ); + 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 response = await fetch(source.url, { redirect: 'follow' }); if (!response.ok || !response.body) { throw new Error(`Failed to download ${name}: HTTP ${response.status}`); @@ -65,8 +66,12 @@ async function download(name, source) { fs.mkdirSync(extracted); if (archive.endsWith('.zip') && process.platform !== 'win32') { execFileSync('unzip', ['-q', archive, '-d', extracted], { stdio: 'inherit' }); - } else { + } 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); } return extracted; }