Conversation
…ty chapters fucknovelpia intermittently serves anti-scrape pages (nginx 403, a custom "Blocked" 429 page, or a Cloudflare rate-limit page) whose bodies contain no .reader markup. parseChapter ignored the HTTP status and returned '' whenever .reader was missing, so a single throttled request rendered as an empty chapter in LNReader (reproduced: HTTP 429 body has no reader markup, parseChapter returned 0 chars). Route all plugin fetches through a shared helper that sends browser-like headers, waits out a 429 once (honoring Retry-After, capped at 10s), and throws with the HTTP status on a refused response. parseChapter now also throws when a 200 page has no reader markup instead of reporting a false empty chapter. Closes lnreader#2540 AI-authored (pi agent), human-reviewed before merge. Co-Authored-By: firstmate-crewmate <crewmate@firstmate.local>
The site's 429 responses omit Retry-After; Number(null) is 0, so the single retry fired immediately and hit the limiter again. Parse the header explicitly so the 2s fallback applies.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
Closes #2540.
fucknovelpia.comintermittently serves anti-scrape pages instead of chapter content (nginx 403, a custom 429 "Blocked" page, a Cloudflare 429 page) — none containing the.readerwrapper.parseChapterignored the HTTP status and returned''when.readerwas missing, so a throttled request rendered as a false empty chapter. The reported chapter is fine: on a 200 it serves the full ~13.5k chars. Reproduced pre-fix: a burst of 12 rapid calls turned a 429 into a zero-length chapter.Retry-After, capped at 10s), and throwing with the HTTP status on refusal.parseChapterthrows when a 200 page has no reader markup instead of returning''.1.1.1→1.1.2.Verification
Burst re-test post-fix: 9 calls OK (retried 429s recovered to 200), 3 honest HTTP 429 throws, 0 silent empties. The reported chapter returns 13,577 chars with neighbors intact;
parseNovelintact (1377 chapters with summary and cover).check:pluginpasses all four steps; eslint, prettier, andbuild:compileclean on the touched file (repo-wide lint/format failures are pre-existing in untouched files).Review follow-up
An AI review of this PR found one defect, fixed in the second commit:
Retry-Afterheader.Number(null)is0, so the retry fired immediately instead of after the intended 2s fallback. Across three live trials, an immediate retry never recovered, while a 2–5s wait sometimes did. The header is now parsed withparseInt, so a missing or non-numeric value falls back to 2s. Verified with a stubbed 429 response and no header: the wait before the retry went from 0 ms to 2000 ms.fetchHtml, the live chapter/novel/search/updates pages return 200 with the expected markup, and the version bump to1.1.2still covers the unreleased change.Ran:
npm run check:plugin -- plugins/english/fucknovelpia.ts(all four checks pass), pluseslintandprettier --checkon the file (both clean). No new tests, per the maintainers' request.AI-authored change (original fix and review follow-up); no human review.