Skip to content

fix(ar): empty chapter bodies and Riwyat novel metadata (Galaxy Novels, Riwyat, Kol Novel, Free Kol Novel) - #2529

Open
RibatTRW wants to merge 5 commits into
lnreader:masterfrom
RibatTRW:fm/lnreader-arabic-empty-chapters
Open

RibatTRW wants to merge 5 commits into
lnreader:masterfrom
RibatTRW:fm/lnreader-arabic-empty-chapters

Conversation

@RibatTRW

@RibatTRW RibatTRW commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2522, #2568, #2486, #2483, #2505, #2465, #2501, #2370, #1566, #2442

Opening a chapter in these sources showed "no content" while the cover, description and chapter list still loaded. Each source was broken for a different reason; four are fixed, and the fifth could not be checked at all and is reported as not verified rather than claimed.

Source Cause Status
Galaxy Novels chapter links were built from a WordPress post id (…/chapter-<post-id>/, which 404s), and the JSON endpoint the plugin preferred answers Cloudflare 403 to third-party clients fixed
Riwyat $('.text-left') || … never reached its later selectors (a cheerio selection is always truthy), and the theme's invisible decoy blocks were returned as text fixed
Kol Novel the body regex required a bottomnav terminator the theme dropped, and hard-coded a <div> wrapper where the theme serves <article> fixed — proxy-verified, not end-to-end
Free Kol Novel the same regex break, plus chapter links point at kolnovel.com so the plugin requested free.kolnovel.com/https://kolnovel.com/… fixed — proxy-verified, not end-to-end
Markazriwayat not reproduced: the site serves a "Coming Soon" page and 404s every other path not verified — no code changed

Folded in as well: Riwyat's novel metadata on the site's new theme (name, cover, summary, author, genres, status and rating all came back empty) through additive fallbacks that only run after the existing selectors yield nothing, so classic-theme sources cannot change behaviour. Issue #2568, a kolnovel empty chapter reported after this PR opened, is the same template defect and is covered by the same fix.

Verification

  • Galaxy Novels: npm run check:plugin — popular 20 ✅, search 1 ✅, parseNovel 30 chapters ✅, parseChapter 13258 chars ✅ (was a 404).
  • Riwyat: popular 12 ✅, search 1 ✅, parseNovel 15 chapters ✅, parseChapter 16910 chars ✅ (was 0 chars).
  • The shared lightnovelwp fix was independently reproduced on a reachable source, TC & Sega: parseChapter FAIL (0 chars) → PASS 5905 chars.
  • Regression sweeps: all 36 lightnovelwp sources before and after — exactly one status change (TC & Sega, FAIL → PASS); 20 madara sources identical; 12 madara sources swept for the metadata fallbacks with no status or body-length change.
  • kolnovel.com and free.kolnovel.com refuse this machine (TCP timeout), so those two were verified by running the plugin's own extraction against live HTML fetched through a text proxy — 14002 chars from the same chapter on both. They stay labelled proxy-verified until one npm run check:plugin run from a network that can reach the server.
  • npm run build:compile exit 0; the lint and format findings are pre-existing on master, in files this PR does not touch.

Not closed

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).
@RibatTRW

Copy link
Copy Markdown
Contributor Author

bro the markaz riwayat website is not even up... i need help with kol novel also, i am able to get the words and characters but the website itself is not up for me...

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.
@RibatTRW RibatTRW changed the title fix(ar): empty chapter bodies in Galaxy Novels, Riwyat, Kol Novel and Free Kol Novel fix(ar): empty chapter bodies and Riwyat novel metadata (Galaxy Novels, Riwyat, Kol Novel, Free Kol Novel) Sep 24, 2026

This branch has not been deployed

No deployments
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.

[kolnovel] Empty chapter: the dominating — العودة بنجاح

1 participant