feat(hoster): resolve MediaFire, PixelDrain and Gofile downloads
Merged
MP
4mo ago+6736+6736+0123456789012345678901234567890123456789-2603-2603-0123456789012345678901234567890123456789
Summary
- resolve MediaFire, PixelDrain, and Gofile pages through backend plugins before transfer while persisting only stable sources
- protect short-lived capabilities with restricted HTTP, typed errors, HTML/truncation checks, and ownership-safe resume cleanup
- keep Link Grabber probing backend-owned and add controlled HTTP/WASM plus adversarial regression coverage
Type
feat
Testing
- Rust: 1,660 passed, 5 ignored; Clippy strict and app-state wiring passed
- Frontend: 725 passed; typecheck, oxlint, targeted oxfmt, and production build passed
- Plugins: MediaFire 59, PixelDrain 55, Gofile 75 tests; Clippy strict and WASM release builds passed
- Native Vortex launch and Link Grabber navigation verified on the Tauri surface
Linear: MAT-133
Summary by cubic
Resolve MediaFire, PixelDrain, and Gofile pages on the backend before download, treat their direct links as protected capabilities, and keep short‑lived URLs/headers server‑only under a restricted HTTP policy. Link Grabber no longer probes hoster pages, shows typed plugin errors, and passes filename/size/resume to download_start. MAT‑133 acceptance covered.
-
New Features
- Backend pre‑resolution via hoster plugins with just‑in‑time refresh; the queue stores only stable source info.
- Multi‑file responses and per‑file request headers supported;
ResolvedDownloadSourcepropagates filename/size/resume to the engine. - Protected‑source policy: credential‑free HTTPS, explicit header allowlist, and strict HTML/XML body‑prefix checks; frontend marks hoster pages as no‑probe and sends remote metadata to
download_start. - Engine/storage: resume based on plugin metadata, persisted‑offset resume, growing writes for unknown sizes, and artifact ownership with tombstones that survive restarts.
-
Bug Fixes
- Disguised or XML‑declared HTML is rejected; protected ranged responses are validated independently; ephemeral URLs/headers are never logged or persisted.
- More robust cleanup/resume: interrupted segments resume from saved offsets, metadata locks preserve read‑only sidecars, unknown‑size retries can’t retain stale trailing bytes, and huge‑file segment limits can’t wrap.
- Capability routing: credentialed/hoster links always use the restricted policy; normal HTTP links keep probing, and the UI shows typed plugin errors without changing status.
Summary by CodeRabbit
-
New Features
- Download start now accepts optional remote metadata (filename, size, resume support) and improves how protected/hoster starts are initialized.
- Link Grabber shows richer resolution details (typed error kind/message) and sends metadata with online probing and start requests.
-
Bug Fixes
- Hardened protected downloads against disguised/unexpected HTML and safer handling of unknown-size/resume retries.
- Added resilient staged metadata recovery and idempotent cleanup of download artifacts.
- Stricter, allowlisted plugin-supplied request headers and tighter resume compatibility checks.
-
Tests
- Expanded end-to-end and unit coverage for protected behavior, mirror failover, cancellation, and storage/resume edge cases.