From b60e8fd4693571e95c13094753ce8b74ef2aa307 Mon Sep 17 00:00:00 2001 From: Igor Morozov Date: Wed, 25 Feb 2026 19:45:43 +0200 Subject: [PATCH] Fix: Pass proxy to download requests The --proxy flag was not being used for downloading translated audio from Yandex S3 (vtrans.s3-private.mds.yandex.net), causing ETIMEDOUT errors when direct access to Yandex is blocked. This change passes the parsed proxyData through to axios download calls in both audio and subtitle download paths. Fixes downloads behind corporate firewalls and in regions where Yandex services are blocked. Changes: - src/download.js: Add proxyData parameter to downloadFile() - src/index.js: Pass proxyData to both downloadFile() calls --- src/download.js | 3 ++- src/index.js | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/download.js b/src/download.js index ec6e190..52db0bc 100644 --- a/src/download.js +++ b/src/download.js @@ -7,7 +7,7 @@ function calcPercents(current, max) { return ((current / max) * 100).toFixed(1); } -export default async function downloadFile(url, outputPath, subtask, videoId) { +export default async function downloadFile(url, outputPath, subtask, videoId, proxyData) { if (!url) { throw new Error("Invalid download link"); } @@ -17,6 +17,7 @@ export default async function downloadFile(url, outputPath, subtask, videoId) { method: "get", url: url, responseType: "stream", + proxy: proxyData || false, }); const totalLength = headers["content-length"]; diff --git a/src/index.js b/src/index.js index e963619..53f8fc3 100644 --- a/src/index.js +++ b/src/index.js @@ -358,6 +358,7 @@ async function main() { `${OUTPUT_DIR}/${filename}`, subtask, `(ID: ${videoId} as ${filename})`, + proxyData, ) .then(() => { subtask.title = `Download ${taskSubTitle} completed!`; @@ -411,6 +412,7 @@ async function main() { `${OUTPUT_DIR}/${filename}`, subtask, `(ID: ${videoId} as ${filename})`, + proxyData, ) .then(() => { subtask.title = `Download ${taskSubTitle} completed!`;