From cbaa0338f448f2405b4458089abd2799ba57983f Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 3 Nov 2024 20:36:30 +0000 Subject: [PATCH] fix: Pass arguments to monolith and yt-dlp as array for better escaping --- apps/workers/crawlerWorker.ts | 2 +- apps/workers/videoWorker.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/workers/crawlerWorker.ts b/apps/workers/crawlerWorker.ts index d5bc555e..f607234e 100644 --- a/apps/workers/crawlerWorker.ts +++ b/apps/workers/crawlerWorker.ts @@ -411,7 +411,7 @@ async function archiveWebpage( await execa({ input: html, - })`monolith - -Ije -t 5 -b ${url} -o ${assetPath}`; + })("monolith", ["-", "-Ije", "-t", "5", "-b", url, "-o", assetPath]); const contentType = "text/html"; diff --git a/apps/workers/videoWorker.ts b/apps/workers/videoWorker.ts index 5448f0fa..a85a8cae 100644 --- a/apps/workers/videoWorker.ts +++ b/apps/workers/videoWorker.ts @@ -98,7 +98,7 @@ async function runWorker(job: DequeuedJob) { `[VideoCrawler][${jobId}] Attempting to download a file from "${url}" to "${assetPath}" using the following arguments: "${ytDlpArguments}"`, ); - await execa`yt-dlp ${ytDlpArguments}`; + await execa("yt-dlp", ytDlpArguments); const downloadPath = await findAssetFile(videoAssetId); if (!downloadPath) { logger.info(