From 0dcd62ac267b09899684389f79fe8e552ab358ca Mon Sep 17 00:00:00 2001 From: Administrator Date: Sun, 19 Apr 2026 22:41:43 +0200 Subject: [PATCH] fix(vidmoly): append X-Progress-ID query param to transit upload URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The transit server runs nginx-upload-progress and requires an X-Progress-ID query parameter on the POST URL to finalize the upload session. Without it the server accepts all bytes but never sends the response — matches the reported 99%-stuck behavior. The browser appends it automatically before submit; we now do the same. --- lib/vidmoly-upload.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/vidmoly-upload.js b/lib/vidmoly-upload.js index d465ab2..25ebbbe 100644 --- a/lib/vidmoly-upload.js +++ b/lib/vidmoly-upload.js @@ -201,10 +201,16 @@ class VidmolyUploader { yield epilogueBuf; } - // Transit server lives on a different domain (*.vmwesa.online). Browsers - // don't send vidmoly.me cookies across origins, so we don't either. - // Origin + Referer match the browser's actual upload headers. - const { body, statusCode, headers } = await request(uploadUrl, { + // Transit server lives on a different domain (*.vmwesa.online) and runs + // the nginx-upload-progress module. It requires an X-Progress-ID query + // parameter on the POST URL — without it the upload hangs at the final + // byte because the module can't finalize the session. Browsers append it + // automatically before submitting the form. + const progressId = Date.now().toString() + Math.floor(Math.random() * 1e6).toString().padStart(6, '0'); + const targetUrl = uploadUrl + (uploadUrl.includes('?') ? '&' : '?') + 'X-Progress-ID=' + progressId; + + // Browsers don't send vidmoly.me cookies across origins, so we don't either. + const { body, statusCode, headers } = await request(targetUrl, { method: 'POST', body: generate(), signal,