Compare commits
No commits in common. "00a46dee2e9c039cbae6e39cad51db674a73e3a2" and "5d43923217e98d41e514a560a9f9b436a4b7a52d" have entirely different histories.
00a46dee2e
...
5d43923217
@ -141,10 +141,9 @@ class VidmolyUploader {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
uploadUrl: payload.upload_url,
|
uploadUrl: payload.upload_url,
|
||||||
// Fields verified from a real browser POST capture.
|
// Classic XFS upload fields in the order the server expects.
|
||||||
// to_json=1 forces a JSON response instead of an HTML redirect page.
|
params: { upload_type: 'file', sess_id: payload.sess_id, srv_tmp_url: '', utype: 'reg' },
|
||||||
params: { sess_id: payload.sess_id, to_json: '1', fld_id: '0' },
|
fileFieldName: 'file_0'
|
||||||
fileFieldName: 'file'
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,33 +244,28 @@ class VidmolyUploader {
|
|||||||
resultHtml = await body.text();
|
resultHtml = await body.text();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try JSON first. The current transit server returns
|
// Try JSON first (some XFS versions return JSON)
|
||||||
// { status: "OK", file_code: "...", msg: "Upload Completed" }.
|
|
||||||
// Legacy XFS shapes (json.files / json.result) are kept as fallback.
|
|
||||||
try {
|
try {
|
||||||
const json = JSON.parse(resultHtml);
|
const json = JSON.parse(resultHtml);
|
||||||
if (json.status && /ok/i.test(json.status) && json.file_code) {
|
|
||||||
return this._buildUrlsFromCode(json.file_code);
|
|
||||||
}
|
|
||||||
if (json.file_code || json.filecode) {
|
|
||||||
return this._buildUrlsFromCode(json.file_code || json.filecode);
|
|
||||||
}
|
|
||||||
if (json.files && json.files.length > 0) {
|
if (json.files && json.files.length > 0) {
|
||||||
const f = json.files[0];
|
const f = json.files[0];
|
||||||
return this._buildUrlsFromCode(f.filecode || f.file_code);
|
const code = f.filecode || f.file_code;
|
||||||
|
return {
|
||||||
|
download_url: code ? `${BASE_URL}/w/${code}` : null,
|
||||||
|
embed_url: code ? `${BASE_URL}/embed-${code}.html` : null,
|
||||||
|
file_code: code
|
||||||
|
};
|
||||||
}
|
}
|
||||||
if (json.result) {
|
if (json.result) {
|
||||||
const r = Array.isArray(json.result) ? json.result[0] : json.result;
|
const r = Array.isArray(json.result) ? json.result[0] : json.result;
|
||||||
const code = r.filecode || r.file_code;
|
const code = r.filecode || r.file_code;
|
||||||
const urls = this._buildUrlsFromCode(code);
|
return {
|
||||||
if (urls) return urls;
|
download_url: r.download_url || (code ? `${BASE_URL}/w/${code}` : null),
|
||||||
}
|
embed_url: r.embed_url || (code ? `${BASE_URL}/embed-${code}.html` : null),
|
||||||
if (json.status && !/ok/i.test(json.status) && json.msg) {
|
file_code: code
|
||||||
throw new Error(`Vidmoly Upload abgelehnt: ${json.msg}`);
|
};
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
if (err && /Vidmoly Upload abgelehnt/.test(err.message)) throw err;
|
|
||||||
}
|
}
|
||||||
|
} catch {}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return this._parseUploadResult(resultHtml);
|
return this._parseUploadResult(resultHtml);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "3.0.1",
|
"version": "3.0.0",
|
||||||
"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