feat(plugin): register vortex-mod-1fichier v1.0.0 (task 38)#152
Conversation
Add registry entry for the new 1fichier hoster plugin (free + premium). The plugin lives in the sibling repo `vortex-mod-1fichier/` and ships with its own GPL-3.0 LICENSE, README, and test fixtures. - Free mode parses the public landing page for filename, size, `wait_seconds`, and a captcha flag. `resolve_stream_url` for free mode surfaces `PluginError::CaptchaRequired` until the captcha solver pipeline ships (task 43+). - Premium mode hits `api.1fichier.com/v1/download/get_token.cgi` with `Authorization: Bearer <key>` (key read via the host's `get_credential` host fn, scoped to the plugin's own service name). Returns the one-shot direct CDN URL plus optional `traffic_used` / `traffic_total` monitoring. - Auto-fallback to free mode when the API rejects the configured key as `InvalidCredentials` or `AccountExpired`. PRD-v2 §P1.19, PRD §4.1, §4.2.
📝 WalkthroughWalkthroughThis PR registers a new official Vortex hoster plugin, ChangesPlugin Registration & Documentation
Sequence DiagramsequenceDiagram
rect rgba(200,220,255,0.5)
participant Client
end
rect rgba(200,255,200,0.5)
participant VortexPlugin
end
rect rgba(255,220,200,0.5)
participant 1fichierAPI
end
Client->>VortexPlugin: Request file URL resolution
VortexPlugin->>1fichierAPI: If API key configured -> request token (download/get_token)
alt Premium token returned (direct CDN URL)
1fichierAPI-->>VortexPlugin: CDN direct URL
VortexPlugin-->>Client: Return direct download (resumable)
else API key rejected or not configured
VortexPlugin->>1fichierAPI: Scrape landing page (extract wait_seconds, captcha flag)
1fichierAPI-->>VortexPlugin: Landing page HTML / indicators
VortexPlugin-->>Client: Return free-mode metadata (wait_seconds, requires_captcha, resumable)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Line 26: The changelog states MAX_BODY_BYTES = 2 MiB but the PR objective and
implementation use 1 MiB; locate the MAX_BODY_BYTES symbol in the code to
confirm the actual numeric constant and then update the CHANGELOG.md entry (the
paragraph describing the body size cap) so the documented value matches the
implementation (i.e., change "2 MiB" to "1 MiB" if the code uses 1 MiB, or
adjust the code to 2 MiB if that was intended); ensure the wording around the
body-size cap remains consistent with the MAX_BODY_BYTES constant and the
IPC/behavior described.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c7bc9801-2c90-4f9a-89ef-56f3e29ae6a1
📒 Files selected for processing (2)
CHANGELOG.mdregistry/registry.toml
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="CHANGELOG.md">
<violation number="1" location="CHANGELOG.md:26">
P3: Update this changelog value to `MAX_BODY_BYTES = 1 MiB` to keep the release notes consistent with the documented plugin behavior.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Merging this PR will improve performance by 24.14%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | normalize_max_concurrent |
150 ns | 120.8 ns | +24.14% |
| ⚡ | normalize_link_check_parallelism |
150 ns | 120.8 ns | +24.14% |
Comparing feat/task-38-1fichier (6901de9) with main (546941d)
Summary
Adds the new official 1fichier hoster plugin to the Vortex registry.
The plugin lives in a sibling repository
vortex-mod-1fichierand isshipped as a v1.0.0 GitHub Release. This PR only touches the Vortex repo to
advertise the new entry through
registry/registry.tomlso the host pluginstore can discover and install it.
Sprint task:
prd-v2-roadmap/38— PRD-v2 §P1.19 / PRD §4.1, §4.2.Why
1fichier is a popular FR hoster on the v0.3 roadmap. The plugin operates in
two modes selected automatically:
under the plugin's own service name (
vortex-mod-1fichier), the pluginposts to
https://api.1fichier.com/v1/download/get_token.cgiwithAuthorization: Bearer <key>and returns the one-shot direct CDN URLplus optional
traffic_used/traffic_totalmonitoring.credential is configured (or when the API rejects the configured key
as
InvalidCredentials/AccountExpired). The parser surfaceswait_seconds(read fromdata-wait,class="countdown", orvar c = …— covers the three layouts 1fichier ships) plus arequires_captchaflag (detected viag-recaptcha/h-captcha/class="captcha") so the host'sWaitManager(task 39) can park thedownload in
Waitingfor the advertised duration before the futurecaptcha solver pipeline (task 43+) takes over.
resolve_stream_urlforfree mode surfaces
PluginError::CaptchaRequireduntil the captchapipeline ships — the metadata path (
extract_links) still succeeds sothe UI can show filename / size / wait countdown.
The premium response parser maps the
{"status":"KO","message":"…"}envelope onto typed errors:
Invalid key→InvalidCredentialsSubscription expired/not premium→AccountExpired(triggersauto-fallback to free mode inside
extract_links)Flood detected/ rate / too many →RateLimitednot found/offline→OfflineInvalidApiResponseBody size capped at
MAX_BODY_BYTES = 1 MiB(real landing pages weigh<100 KB) against memory abuse from a malicious server.
FileLink.resumableis reported astrueso the host's segmented engineengages multi-connection ranged downloads.
Changes
registry/registry.toml: new[[plugin]]entry pinning v1.0.0 withboth the WASM (
02035a49…3232c) andplugin.toml(c16cb7d4…87c091)SHA-256 checksums, so a mutated artefact is refused at install time.
CHANGELOG.md:[Unreleased] / Addedentry summarising the plugincontract, URL recognition pattern (
(www\.)?1fichier\.com/?<id>,6-char minimum id), the dual-mode dispatch (premium API + free
landing scrape), the typed-error classifier, the
wait_seconds/requires_captchaIPC fields, and the test count (53 unit + 10fixture + 3 WASM smoke).
IPC envelope additions
The plugin's
extract_linksresponse carries the standardid/url/filename/size_bytes/direct_url/resumableshape, plus four1fichier-specific fields:
mode: "free" | "premium"— disambiguates which path produced theresponse so the host can surface the right UI affordances
wait_seconds: Option<u32>— populated only in free mode;Noneforpremium (or when no countdown was advertised)
requires_captcha: bool—truewhen the free landing page rendereda CAPTCHA; always
falsefor premiumtraffic_used_bytes/traffic_total_bytes: Option<u64>— populatedonly in premium mode when the API includes them in the response
Existing host code that ignores unknown fields keeps working unchanged.
Test plan
cargo test --workspace(vortex backend) — 1450 passed, 5 ignored, no regressioncargo clippy --workspace -- -D warningscleancargo fmt --checkcleannpx vitest run(frontend) — 688 PASS / 0 FAILnode_modules/.bin/oxlint .(frontend) — 0 warnings, 0 errorscargo test— 67 passed across 4 suites (53 unit + 10 fixture + 3 WASM smoke)cargo clippy --all-targets -- -D warningscleanpython3 -c "import tomllib; tomllib.loads(open('registry/registry.toml').read())")Summary by cubic
Registers the new
vortex-mod-1fichierv1.0.0 hoster plugin in the Vortex registry so it’s installable from the plugin store. Supports premium (API key) and free mode (wait + captcha stub) with auto-fallback, aligning with Linear task 38 (PRD‑v2 P1.19).[[plugin]]entry inregistry/registry.tomlforvortex-mod-1fichierv1.0.0 with repository link,checksum_sha256for wasm and manifest, markedofficial, andmin_vortex_version = "0.1.0".CHANGELOG.mdto document URL matching, dual-mode behavior, typed error mapping, IPC fields, offline detection, and the MAX_BODY_BYTES cap set to 1 MiB (docs aligned with implementation).Written for commit 6901de9. Summary will update on new commits.
Summary by CodeRabbit