Harden Mega web flow and smooth download runtime
Build and Release / build (push) Has been cancelled

This commit is contained in:
Sucukdeluxe
2026-02-27 06:17:15 +01:00
parent 40bfda2ad7
commit 583d74fcc9
9 changed files with 198 additions and 61 deletions
+9 -1
View File
@@ -1,5 +1,6 @@
import { DebridService } from "../src/main/debrid";
import { defaultSettings } from "../src/main/constants";
import { MegaWebFallback } from "../src/main/mega-web-fallback";
const links = [
"https://rapidgator.net/file/837ef967aede4935e3e0374c4e663b40/GTHDERTPIIP7P401.part1.rar.html",
@@ -26,7 +27,13 @@ if (!settings.token && !(settings.megaLogin && settings.megaPassword) && !settin
}
async function main(): Promise<void> {
const service = new DebridService(settings);
const megaWeb = new MegaWebFallback(() => ({
login: settings.megaLogin,
password: settings.megaPassword
}));
const service = new DebridService(settings, {
megaWebUnrestrict: (link) => megaWeb.unrestrict(link)
});
for (const link of links) {
try {
const result = await service.unrestrictLink(link);
@@ -35,6 +42,7 @@ async function main(): Promise<void> {
console.log(`[FAIL] ${String(error)}`);
}
}
megaWeb.dispose();
}
void main();