Skip to content

fix(scraper-hook): move beforecreate to the enrich band - #4

Merged
agalwood merged 1 commit into
mainfrom
fix/2189_scraper_enrich_band_20260923
Sep 23, 2026
Merged

agalwood merged 1 commit into
mainfrom
fix/2189_scraper_enrich_band_20260923

Conversation

@agalwood

Copy link
Copy Markdown
Member

Refs agalwood/Motrix#2189.

What

  • motrix.scraper-hook now runs its beforeCreate hook in the enrich role band instead of pre-resolve.
  • The version goes to 1.1.0, which also ships the single three-second discovery deadline already merged in fix(scraper): bound optional discovery to one deadline #3.
  • The README (both languages) and CLAUDE.md now say the plugin fails open and is no longer bundled with Motrix.

Why

pre-resolve makes a failure fatal: the hook chain is aborted, and with it the task. With *://*/* host permissions, one slow or failing page lookup blocked every new HTTP download ("plugin chain aborted: motrix.scraper-hook: plugin hook aborted"). Finding a direct link on an HTML page is an optional convenience and should never veto a download. In the enrich band, a failure or overrun drops the plugin's contribution and Motrix downloads the URL the user gave.

pre-resolve is also reserved for builtin plugins. Motrix is retiring scraper-hook from its bundled set (agalwood/Motrix companion PR), so without this change the plugin could not load there at all.

Verification

  • pnpm vitest run plugins/motrix.scraper-hook: 9 passed.
  • pnpm lint and pnpm -r typecheck are clean.

No release or lockfile bump is needed on the Motrix side, because the plugin is leaving the bundled set.

The hook ran in the pre-resolve band, which fails its chain closed. With
`*://*/*` host permissions, any failure or slow page aborted the creation
of every HTTP task (agalwood/Motrix#2189). Looking up a direct link on an
HTML page is an optional convenience and must never veto a download.

Run beforeCreate in the enrich band. There a failure or overrun drops the
plugin's contribution and Motrix downloads the URL the user gave.
pre-resolve is also reserved for builtin origin, and Motrix is retiring
the plugin from its bundled set, so the plugin could not load there
without this change.

Bump to 1.1.0, which also ships the single three-second discovery
deadline merged in #3. Document the move in the READMEs.
@agalwood
agalwood merged commit 488f435 into main Sep 23, 2026
1 check passed
@agalwood
agalwood deleted the fix/2189_scraper_enrich_band_20260923 branch October 9, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant