Repository navigation
Conversation
parseNovel preferred the data-chapter-id attribute (a WordPress post id) over the chapter link and built `…/chapter-<post-id>/` paths, which the site answers with 404 — only `…/chapter-<number>/<slug>/` resolves, so every chapter list it produced was unusable. parseChapter then asked `wp-json/wor-reader-app/v1/chapters/<id>` first; that route exists but Cloudflare answers 403 to every non-app client (reproduced from a real browser with a same-origin fetch), and the HTML fallback looked for selectors the theme no longer ships. Read the body from the article marked up as https://schema.org/Chapter instead, taking the first candidate that actually contains text. Fixes the chapter body for Galaxy Novels (issue lnreader#2522).
`$('.text-left') || $('.text-right') || …` never reaches the second
selector: a cheerio selection object is always truthy, so a page without
`.text-left` returned an empty chapter instead of trying the rest. Walk
the selectors and keep the first one that actually contains text, and add
the anchors the Madara-derived themes read from (`.text-content`,
`.text-chapter-content`, `novel-chapter`, `.reading-content`).
The riwyat source (cenele.com) also hides scraped-text decoys in
`<section inert data-nosnippet>` blocks that its inline CSS makes
invisible and wraps the body in a per-request random class, so its
customJs now drops those sections along with in-body style/script tags
and the app-promo blocks.
Fixes the chapter body for Riwyat (issue lnreader#2522).
The chapter body regex required a `<div class="epcontent …">` wrapper and a `<div class="bottomnav">` terminator, and sliced the raw document between them. Newer installs render the body as `<article class="epcontent …">` and close it with `<nav class="bottomnav">` or with nothing at all, so the regex stopped matching and every chapter came back empty. Select the body itself and return its paragraphs. Chapter links that point at the main site (free.kolnovel.com links kolnovel.com) are now reduced to their path, because parseChapter always re-prefixes `this.site` and the absolute URL produced `https://free.kolnovel.com/https://kolnovel.com/…`. Fixes the chapter body for Kol Novel and Free Kol Novel (issue lnreader#2522).
Riwyat (cenele.com) migrated to a custom NHV theme whose novel pages no longer render the classic Madara detail blocks, so parseNovel returned an empty name, cover, summary, author and genres. Try each existing selector first and only fall through to the theme-specific markup (h1.nhv-novel-title, .nhv-novel-cover img, .nhv-novel-synopsis p, .nhv-novel-meta author links, .nhv-novel-genres a, .nhv-novel-status, .nhv-simple-rating__avg) when it yields nothing, leaving classic-theme sources unchanged. Pairs with the parseChapter selector-chain fix for the same source; this change stays out of parseChapter and sources.json. AI-authored change, no human review claimed.
The novel page only renders the latest 30 chapters and data-index-url is empty, so parseNovel now reads data-manifest-url from the chapters container, merges the pack file with live_tail the way the site reader does, and falls back to the page-derived list when the manifest is absent or malformed. This change was authored by an AI coding agent. Co-Authored-By: firstmate-crewmate <crewmate@firstmate.local>
Owner
Author
|
This change now lives in lnreader#2529. It was cherry-picked there unchanged as 99d71f3 (Galaxy Novels 1.1.1 → 1.1.2). lnreader#2529 now closes lnreader#2667 and lnreader#2490. Re-checked against the live site on 2026-10-11. The chapter manifest path still works:
Each list is numbered 1..N with no gaps, and chapter 1 opens. Before the fix each novel showed only the latest 30. lnreader#2529 also adds one follow-up for this plugin: when it falls back to the 30 chapters on the novel page, it now lists them oldest first. Screenshots below are from this repo's plugin playground, run in headless Chromium, not from the LNReader app. This comment was written by an AI coding agent working for the PR author. |
RibatTRW
force-pushed
the
fm/lnreader-arabic-empty-chapters
branch
from
November 3, 2026 22:49
be436fd to
13ba9a5
Compare
RibatTRW
force-pushed
the
fm/lnreader-arabic-empty-chapters
branch
from
November 18, 2026 22:51
c87fddb to
5e19ac2
Compare
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
Stacks on lnreader#2529 — merge after it. This branch sits on that PR's head, so the diff here is only the chapter-list fix on top. Fixes lnreader#2490.
Galaxy Novels novel pages render only the latest 30 chapters (
data-per-page="30", 30data-chapter-iditems) with an emptydata-index-url, soparseNovelfell through to the page list and returned just the latest 30 — chapters 1–621 of a 651-chapter novel were unreachable.parseNovelnow readsdata-manifest-urlfrom the chapters container and loads the full index the way the site's own reader does: the manifest'spack_urlfile holding every chapter, withlive_tailmerged over the pack by chapter id (newest wins), sorted ascending. When the manifest is absent, unreachable, or malformed it returns null andparseNovelfalls back to the existing HTML list — never an empty list. Only the chapters-container manifest is used; the second manifest on the page covers the VIP time-locked schedule and is ignored, matching the total the site itself renders. Chapter-body and lock handling are untouched. Version1.1.1→1.1.2.Verification (live, 2026-09-24)
check:plugin: 30 chapters before, 651 after; popular (20), search (1), and chapter steps pass. Served counts equal the manifest's own totals in the same run (651/651, 3155/3155, 234/234), numbering contiguous 1..N with no gaps or duplicates; a previously unreachable first chapter returns full text. Fallback proven with manifest requests blocked (30 page-derived chapters, not empty).build:compileandbuild:multisrcpass; eslint clean on the touched file (2 repo-wide errors pre-existing). AI-authored change, no human review.