Release v1.4.16 with crash prevention and hang protection

- Add 30s fetch timeouts to ALL API calls (Real-Debrid, BestDebrid, AllDebrid, Mega-Web)
- Fix race condition in concurrent worker indexing (runWithConcurrency)
- Guard JSON.parse in RealDebrid response with try-catch
- Add try-catch to fs.mkdirSync in download pipeline (handles permission denied)
- Convert MD5/SHA1 hashing to streaming (prevents OOM on large files)
- Add error handling for hash manifest file reading
- Prevent infinite hangs on unresponsive API endpoints

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sucukdeluxe
2026-02-27 21:43:40 +01:00
co-authored by Claude Opus 4.6
parent 147269849d
commit ea6301d326
7 changed files with 58 additions and 21 deletions
+8 -4
View File
@@ -155,7 +155,8 @@ export class MegaWebFallback {
password,
remember: "on"
}),
redirect: "manual"
redirect: "manual",
signal: AbortSignal.timeout(30000)
});
const cookie = parseSetCookieFromHeaders(response.headers);
@@ -169,7 +170,8 @@ export class MegaWebFallback {
"User-Agent": "Mozilla/5.0",
Cookie: cookie,
Referer: DEBRID_REFERER
}
},
signal: AbortSignal.timeout(30000)
});
const verifyHtml = await verify.text();
const hasDebridForm = /id=["']debridForm["']/i.test(verifyHtml) || /name=["']links["']/i.test(verifyHtml);
@@ -194,7 +196,8 @@ export class MegaWebFallback {
links: link,
password: "",
showLinks: "1"
})
}),
signal: AbortSignal.timeout(30000)
});
const html = await page.text();
@@ -215,7 +218,8 @@ export class MegaWebFallback {
body: new URLSearchParams({
code,
autodl: "0"
})
}),
signal: AbortSignal.timeout(15000)
});
const text = (await res.text()).trim();