Repository navigation
Conversation
Some Toasteful novels (e.g. "I Was Reincarnated as a Nameless Combatant in a Japanese-style Fantasy Depressive Erotic Game...", mob-yandere) link only part 1 of each chapter from the novel page; parts 2+ are separate posts reached only through the chapter's "Next CH." link, so the app showed just the first part. parseChapter now follows "Next CH." while it leads to a post that shares the chapter's slug stem and is not linked from the novel page, and joins the parts. When a post ships an empty "Next CH." (the site fills it in client-side), the next part number is tried instead. Parts the novel page lists as their own chapters, and the next chapter of a novel, are left alone. Closes lnreader#2705
[Medium impact] Loads multi-part chapters from a web novel source. Fix the empty later-page check before merging so incomplete chapters do not look successfully loaded. Findings
SummaryUpdates Toasteful to load later chapter parts and join them with
Acknowledged behavior: RibatTRW explicitly describes stopping at HTTP 404 and limiting chapters to 20 parts. These limits were not reported as defects. Reviews (1) · Last reviewed commit: "no-mistakes(review): throw on non-404 fa..." · Reviewed by Greptile |
| const $part = loadCheerio(await response.text()); | ||
| next = $part('.ChapterNav a.next').attr('href'); | ||
| parts.push(this.chapterContent($part)); |
There was a problem hiding this comment.
If a later part returns HTTP 200 without chapter text, chapterContent returns an empty string and this loop appends it without checking. Part 1 alone can satisfy the combined 200-character check, so parseChapter returns an incomplete chapter as a success.
Reject later pages with no readable text before appending them. Short but valid parts can still use the combined length check.
Knowledge Base Used: English source plugins
There was a problem hiding this comment.
Agreed, fixed in 752534a. A later part whose cleaned content has no readable text now throws Toasteful: no readable chapter text was found in <part path>. instead of being appended. Short but non-empty parts still go through the combined length check. I checked this by forcing part 2 of mob-yandere-4-1 to return HTTP 200 with an empty body. The previous head returned part 1 as a success, and now it throws. A full pass over the reporter's novel still reads the same 791 of 805 posts, so no real part is empty. (Reply written with an AI coding agent.)
A later part that returns HTTP 200 with no readable text was appended as an empty string, and part 1 alone could satisfy the combined length check, so an incomplete chapter was returned as a success. Throw when a later part has no readable text; short but non-empty parts still pass.
Summary
Fixes #2705. On some Toasteful novels, LNReader shows only the first part of a chapter that the site splits into parts.
The reporter's novel, I Was Reincarnated as a Nameless Combatant in a Japanese-style Fantasy Depressive Erotic Game, but the Women Around Me Are All Dangerous, and I Have a Bad Feeling about It (
/2022/11/mob-yandere.html), links only part 1 of each chapter from its novel page. For example, "Chapter 4" links tomob-yandere-4-1.html. Parts 2–5 are separate posts that a reader reaches through the chapter's "Next CH." link. The site's sitemap has 805 posts for this novel, but its novel page links only 263, so the plugin never saw the other parts. A few chapters in other novels have the same layout, for examplekokuyaku-v1c23-2,hajimari-trainer-v3c12-2,hero-mother-66-2andenchanting-mage-v17c18-2.I also checked two other possible causes, and neither applies. No novel page drops number-only part links: I checked all 72 novels. No chapter post hides parts behind tabs or in-post pagination: I checked 30 sampled "Part" chapters.
parseChapternow follows "Next CH." from a chapter and joins the parts. It does this only while the next post continues the same chapter and is not linked from the novel page. The PR's own changes are listed under "What Changed" below.Before / after (reporter's novel, plugin
parseChapter)mob-yandere-4-1)mob-yandere-10-1)mob-yandere-89-1)kokuyaku-v1c28andkokuyaku-v1c28-2).hero-mother-379→hero-mother-380).mob-yandere-155-3-revise,mob-yandere-183-2-rev).mob-yandere-149,mob-yandere-195).7425d56) returned the chapter as a success with only part 1. It now throwsToasteful: no readable chapter text was found in /2022/11/mob-yandere-4-2.html.A short but non-empty part is still accepted. On the live novel, all chapters still load (791 of 805 posts read, same as before), so no real part is empty.<hr>tags, and chapters contain<hr>tags of their own. For example, Chapter 10 (mob-yandere-10-1) has 2 parts on the site, not 5.npm run check:plugin -- plugins/english/toasteful.tspasses, and ESLint and Prettier are clean.Screenshots (plugin playground, live site)
The reporter's novel in Parse Novel:
Chapter 4 in Parse Chapter. The end of part 1 runs straight into the start of part 2 ("For the note, it is surprisingly difficult…"):
The popular list still loads:
What Changed
parseChapterinplugins/english/toasteful.tsnow follows the chapter's "Next CH." link and appends each later part, joined with<hr>. This covers novels whose novel page links only part 1 (e.g. mob-yandere), so the rest of the chapter is no longer cut off.chapterContenthelper. Plugin version bumped from 1.0.1 to 1.0.2.Risk Assessment
✅ Low: The change is confined to one plugin's parseChapter. It follows the recorded decision (throw on non-404 failures, break on 404), and the slug and listing guards stop it from running into the next real chapter.
Testing
I bundled the plugin and ran it against the live toasteful.com site. Search found the reported novel, and parseNovel returned 266 chapters. Loading chapter mob-yandere-10-1 returned 38,707 characters in 5 parts joined by<hr>. With part 2 forced to HTTP 429, the chapter threw "Toasteful: HTTP 429." instead of returning only part 1. With part 2 forced to 404, the chapter ended there and returned 2 parts. The repo'scheck:pluginpassed on all four checks. I did not run the base commit for comparison. I did not post the PR JSON reply on the issue comment, because that is a later delivery step.<hr>separators), 38707 charactersnpm run check:pluginoutput: popularNovels, searchNovels, parseNovel and parseChapter all PASSEvidence: live driver output
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
<hr>separators), 38707 charactersnpm run check:pluginoutput: popularNovels, searchNovels, parseNovel and parseChapter all PASSnpm run check:plugin -- plugins/english/toasteful.ts(passed)Bundled the real plugin and ran searchNovels, parseNovel and parseChapter on the reported novel against the live siteSame run with part 2 of mob-yandere-10-1 forced to return 429, then 404✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.