Compare commits

..

No commits in common. "7ea718ee2770a1d140f5d610d0b548cab30b00d1" and "c8aeaf1de0a19992a61693285fbb52e44d0e3f33" have entirely different histories.

2 changed files with 6 additions and 10 deletions

View File

@ -141,8 +141,7 @@ class VidmolyUploader {
} }
return { return {
uploadUrl: payload.upload_url, uploadUrl: payload.upload_url,
// Classic XFS upload fields in the order the server expects. params: { sess_id: payload.sess_id, utype: 'reg' },
params: { upload_type: 'file', sess_id: payload.sess_id, srv_tmp_url: '', utype: 'reg' },
fileFieldName: 'file_0' fileFieldName: 'file_0'
}; };
} }
@ -201,20 +200,17 @@ class VidmolyUploader {
yield epilogueBuf; yield epilogueBuf;
} }
// Transit server lives on a different domain (*.vmwesa.online). Browsers // Use undici.request for the upload (streaming body for progress)
// 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, { const { body, statusCode, headers } = await request(uploadUrl, {
method: 'POST', method: 'POST',
body: generate(), body: generate(),
signal, signal,
headers: { headers: {
'User-Agent': USER_AGENT, 'User-Agent': USER_AGENT,
'Accept': '*/*', 'Cookie': this._cookieHeader(),
'Origin': BASE_URL,
'Referer': `${BASE_URL}/`,
'Content-Type': `multipart/form-data; boundary=${boundary}`, 'Content-Type': `multipart/form-data; boundary=${boundary}`,
'Content-Length': String(totalSize) 'Content-Length': String(totalSize),
'Referer': `${BASE_URL}/upload.html`
}, },
headersTimeout: UPLOAD_TIMEOUT, headersTimeout: UPLOAD_TIMEOUT,
bodyTimeout: UPLOAD_TIMEOUT bodyTimeout: UPLOAD_TIMEOUT

View File

@ -1,6 +1,6 @@
{ {
"name": "multi-hoster-uploader", "name": "multi-hoster-uploader",
"version": "2.9.9", "version": "2.9.8",
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously", "description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {