Commit Graph

14 Commits

Author SHA1 Message Date
Sucukdeluxe
0be5248a36 Fix: Mega-Debrid Web-Rotation nutzt jetzt die Per-Account-Credentials (echter Rotations-Bug)
Root-Cause (verifiziert via Support-Bundle): Der Web-Unrestrict lief fuer JEDEN rotierten
Account mit den Creds des ersten/Legacy-Accounts (settings.megaLogin), weil MegaWebFallback
EINE geteilte Cookie-Session + festes getCredentials() nutzte UND megaWebUnrestrict ohne
Account-Bezug aufgerufen wurde. Item-Log-Beweis: "Account 2/2 (FabelDavid): Mega-Web Antwort
leer", obwohl FabelDavid real funktioniert — die Rotation nutzte FabelDavid nie wirklich,
sondern immer Account 1 (am Limit). Alle bisherigen Fixes (v1.7.169-172) lagen downstream
dieses Punkts und konnten den Bug nicht beheben.

Fix:
- MegaWebUnrestrictor bekommt optionalen `account`-Parameter; MegaDebridClient.unrestrictViaWeb
  reicht this.login/this.password (den rotierten Account) durch; app-controller leitet ihn weiter.
- MegaWebFallback: Per-Login Session-Cache (Map<login,{cookie,setAt}>) statt einem geteilten
  Cookie; login() gibt das Cookie zurueck, generate() bekommt es als Param. Jeder Account nutzt
  seine eigene Session — kein Re-Login-Thrash unter Parallel-Last (maxParallel=8).

Tests: mega-web-fallback (Login-POST traegt den uebergebenen Account-Login, nicht den Default)
+ debrid-Rotation (jeder Account erhaelt SEINE Creds; Account 2 loest auf). 647 Tests gruen,
tsc 9, Build sauber.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 19:59:37 +02:00
Sucukdeluxe
9d8351c017 Fix: Mega-Debrid "Kein Server fuer diesen Hoster" (Tageslimit) -> schnell scheitern + rotieren
User-Report: Account 1 am Tageslimit liefert "Kein Server fuer diesen Hoster verfuegbar".
Bisher lief das durch die volle Web-Retry-Maschine (generate->null -> re-Login -> 3x
REQUEST_RETRIES) und fraß ~40s des GETEILTEN 60s-Unrestrict-Budgets -> der funktionierende
naechste Account (FabelDavid) lief in den Timeout (aborted:debrid -> als fatal klassifiziert,
"abgebrochen (fataler Fehler)" im Rotations-Verlauf), obwohl er gehen wuerde.

Fix (3 Teile, gemeinsame MEGA_DEBRID_NO_SERVER_RE):
1. mega-web-fallback generate(): die "Kein Server"-Meldung wird surfacet (throw) statt
   null zurueckzugeben -> kein re-Login + erneutes Pollen.
2. unrestrictViaWeb: bricht bei der Meldung ab (kein 3x-REQUEST_RETRIES) -> sofortige
   Retries sind zwecklos (Limit bleibt) und verbrennen das geteilte Rotations-Budget.
3. classifyAccountFailure: erkennt die Meldung -> quota-Cooldown (2 min) -> naechster
   Account, mit echter Meldung im Log statt generischem "Antwort leer".

So scheitert der limitierte Account schnell (1 Versuch) und der naechste Account bekommt
das volle Budget zum Aufloesen.

Tests: mega-web-fallback (throw + ajaxCalls=1) + debrid-Rotation (acc1 Limit -> acc2,
calls=2). 645 Tests gruen, tsc 9, Build sauber.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 19:23:49 +02:00
Sucukdeluxe
d9170f4167 Refactor: Extractor in 18 Sektionen reorganisiert 2026-03-10 23:47:02 +01:00
Sucukdeluxe
a1c8f42435 Comprehensive bugfix release v1.6.45
Fix ~70 issues across the entire codebase including security fixes,
error handling improvements, test stabilization, and code quality.

- Fix TLS race condition with reference-counted acquire/release
- Bind debug server to 127.0.0.1 instead of 0.0.0.0
- Add overall timeout to MegaWebFallback
- Stream update installer to disk instead of RAM buffering
- Add path traversal protection in JVM extractor
- Cache DdownloadClient with credential-based invalidation
- Add .catch() to all fire-and-forget IPC calls
- Wrap app startup, clipboard, session-log in try/catch
- Add timeouts to container.ts fetch calls
- Fix variable shadowing, tsconfig path, line endings
- Stabilize tests with proper cleanup and timing tolerance
- Fix installer privileges, scripts, and afterPack null checks
- Delete obsolete _upload_release.mjs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 03:53:28 +01:00
Sucukdeluxe
2ef3983049 Revert to v1.5.49 base + fix "Ausgewählte Downloads starten"
- Restore all source files from v1.5.49 (proven stable on both servers)
- Add startPackages() IPC method that starts only specified packages
- Fix context menu "Ausgewählte Downloads starten" to use startPackages()
  instead of start() which was starting ALL enabled packages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 17:53:39 +01:00
Sucukdeluxe
e6ec1ed755 Add Mega-Debrid account info check (web scraping)
Scrapes the Mega-Debrid profile page to display username, premium status,
remaining days, and loyalty points. New "Account prüfen" button in Settings > Accounts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:06:19 +01:00
Sucukdeluxe
09bc354c18 Detect dead links as permanent errors, fix last-episode extraction race
Some checks failed
Build and Release / build (push) Has been cancelled
Dead link detection:
- Mega-Web: parse hoster error messages (hosterNotAvailable, etc.) from HTML
  and throw specific error instead of returning null
- MegaDebridClient: stop retrying on permanent hoster errors
- download-manager: isPermanentLinkError() immediately fails items with dead
  links instead of retrying forever

Extraction race condition:
- package_done cleanup policy checked if all items were "completed" (downloaded)
  but not if they were "extracted" — removing the package before the last
  episode could be extracted
- Both applyCompletedCleanupPolicy and applyPackageDoneCleanup now guard
  against premature removal when autoExtract is enabled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:28:23 +01:00
Sucukdeluxe
550942aad7 Overhaul download retry pipeline: circuit breaker, escalating backoff, shelve logic
- Provider circuit breaker: track consecutive failures per provider with
  escalating cooldowns (30s/60s/120s/300s), auto-invalidate Mega-Debrid
  session on cooldown
- Escalating backoff: retry delays now scale up to 120s (was 30s max),
  unrestrict backoff exponential instead of linear 15s cap
- Shelve logic: after 15 consecutive failures, item pauses 5 min with
  counter halving for gradual recovery
- Periodic soft-reset: every 10 min, reset stale retry counters (>10 min
  queued) and old provider failures (>15 min), acts like mini-restart
- Mega-Debrid queue timeout: 90s wait limit in runExclusive to prevent
  cascade blocking behind stuck calls
- Provider-cooldown-aware retry delays: items wait for provider cooldown
  instead of retrying against broken service
- Fix: reconnect/package_toggle now persist retry counters (previously
  lost on interruption, defeating shelve logic)
- Mega-Debrid generate: tighter timeouts, progressive reload backoff,
  hoster retry limit (5x max)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:00:17 +01:00
Sucukdeluxe
1825e8ba04 ️ perf: improve extraction status, stuck detection, and retry logic
Some checks failed
Build and Release / build (push) Has been cancelled
- Extraction status: "Entpackt - Done" / "Entpacken - Ausstehend"
- Per-item extraction progress (no cross-contamination)
- Validating-stuck watchdog: abort items stuck >45s in "Link wird umgewandelt"
- Global stall timeout reduced 90s → 60s, unrestrict timeout 120s → 60s
- Unrestrict retry: longer backoff (5/10/15s), reset partial downloads
- Stall retry: reset partial downloads for fresh link
- Mega-Web generate: max 30 polls (was 60), 45s overall timeout
- Mega-Web session refresh: 10min (was 20min)
- Comprehensive logging on all retry/failure paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 22:38:46 +01:00
Sucukdeluxe
647679f581 Fix Mega-Web unrestrict hangs and release v1.4.66
Some checks failed
Build and Release / build (push) Has been cancelled
2026-03-01 19:06:34 +01:00
Sucukdeluxe
ea6301d326 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>
2026-02-27 21:43:40 +01:00
Sucukdeluxe
583d74fcc9 Harden Mega web flow and smooth download runtime
Some checks failed
Build and Release / build (push) Has been cancelled
2026-02-27 06:17:15 +01:00
Sucukdeluxe
b1b8ed4180 Switch Mega web fallback to real debrideur form flow and bump to 1.1.20
Some checks failed
Build and Release / build (push) Has been cancelled
2026-02-27 05:47:19 +01:00
Sucukdeluxe
0e898733d6 Restore in-app updater and add Mega web fallback path
Some checks failed
Build and Release / build (push) Has been cancelled
2026-02-27 05:28:50 +01:00