Compare commits
2 Commits
215a10186e
...
0bf3061852
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0bf3061852 | ||
|
|
79cf8ad002 |
@ -190,20 +190,25 @@ class ClouddropUploader {
|
|||||||
try { fs.closeSync(fd); } catch {}
|
try { fs.closeSync(fd); } catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Complete session
|
// 3. Complete session — all bytes are already on the server at this point.
|
||||||
const completeRes = await request(`${API_BASE}/upload/${sessionId}/complete`, {
|
// We MUST NOT throw here, otherwise the upload-manager would retry the entire
|
||||||
method: 'POST',
|
// multi-GB upload. Any failure (timeout, non-JSON, missing fileId, server still
|
||||||
dispatcher: clouddropAgent,
|
// post-processing) is swallowed and we fall back to sessionId as file_code.
|
||||||
signal,
|
try {
|
||||||
headers: this._headers({ 'Content-Type': 'application/json' }),
|
const completeRes = await request(`${API_BASE}/upload/${sessionId}/complete`, {
|
||||||
body: '{}',
|
method: 'POST',
|
||||||
headersTimeout: COMPLETE_TIMEOUT,
|
dispatcher: clouddropAgent,
|
||||||
bodyTimeout: COMPLETE_TIMEOUT
|
signal,
|
||||||
});
|
headers: this._headers({ 'Content-Type': 'application/json' }),
|
||||||
const completePayload = await this._parseJsonResponse(completeRes);
|
body: '{}',
|
||||||
const fileId = completePayload.fileId || completePayload.id;
|
headersTimeout: COMPLETE_TIMEOUT,
|
||||||
if (!fileId) throw new Error('Clouddrop: Keine fileId in /upload/complete Antwort');
|
bodyTimeout: COMPLETE_TIMEOUT
|
||||||
return fileId;
|
});
|
||||||
|
const completePayload = await this._parseJsonResponse(completeRes).catch(() => ({}));
|
||||||
|
return completePayload.fileId || completePayload.id || sessionId;
|
||||||
|
} catch {
|
||||||
|
return sessionId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "2.7.4",
|
"version": "2.7.5",
|
||||||
"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": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user