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).
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.
…odies - madara: a chapter candidate that holds only images (illustration or comic chapters) counts as content again; the text-only test skipped it and returned an empty body where master rendered the images. - madara, lightnovelwp: throw a clear error when no chapter body is found instead of returning an empty string. - galaxynovels: throw instead of returning "Content not available." as if it were the chapter text.
This was referenced Sep 28, 2026
Resolve plugins/multisrc/lightnovelwp/template.ts: keep master's lnreader#2611 chapter HTML/image handling and sanitizing, select `.epcontent` (div or article) per this PR, and throw when the body is missing or empty.
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.
Closes #2522, #2568, #2486, #2483, #2505, #2465, #2501, #2370, #1566, #2442, #2576, #2578
Opening a chapter in these Arabic sources showed "no content", even though the cover, description and chapter list still loaded. Each source broke for a different reason. Four are fixed. The fifth, Markazriwayat, could not be checked at all, so it is listed as not verified instead of fixed.
…/chapter-<post-id>/, which 404s), and the JSON endpoint the plugin preferred answers Cloudflare 403 to third-party clients$('.text-left') || …never reached its later selectors (a cheerio selection is always truthy), and the theme's invisible decoy blocks were returned as textbottomnavterminator that the theme dropped, and hard-coded a<div>wrapper where the theme serves<article>kolnovel.com, so the plugin requestedfree.kolnovel.com/https://kolnovel.com/…This PR also fixes Riwyat's novel metadata on the site's new theme, where name, cover, summary, author, genres, status and rating all came back empty. The fix adds fallbacks that run only after the existing selectors find nothing, so sources on the classic theme keep their current behaviour. Issues #2568, #2576 and #2578 report empty Kol Novel-family chapters; they come from the same template defect and this fix covers them.
Strengthening pass
A second pass reviewed the changes to the two shared templates (
madaraandlightnovelwp), because dozens of other sources use them. It made three small changes. Each one prevents a specific failure, shown before and after in the evidence below:<img>inside.text-lefthas no text, so this PR's first version returned an empty body wheremastershowed the images. A candidate that contains images now counts as content too.parseChapterused to return"". It now throwsChapter text not found on the page, try to open in webview.The error only replaces cases that returned an empty string, so any chapter that returned text before returns the same text.<p>Content not available.</p>as though it were the chapter, and a download would have saved that text. The plugin now throws instead.This pass made no other changes. Kol Novel and Free Kol Novel still cannot be reached from the machine used for testing (TCP timeout), so they remain verified through a proxy only.
Issue #2522
#2522 reports "no content" when opening a chapter on Kol Novel, Free Kol Novel and Riwyat (its labels name Galaxy Novels and Markazriwayat, but the report text names the Kol Novel family and Riwyat). Against today's live sites this PR covers it as follows:
check:pluginrun can reach them (fetch failed→ INCONCLUSIVE). The fix was re-verified on live chapter HTML fetched through a proxy: the old regex returns 0 chars and the new selector returns the full body (29,415 chars / 254 paragraphs on the sampled chapter). Free Kol Novel's cross-host chapter links were also re-confirmed.Currency (2026-09-28)
masterhas 16 newer commits since this branch's base. They touch the sharedmadaratemplate (a Translator-author fallback and a Summary fallback) andmadara/sources.json(add Tangerine Archive, drop two dead entries), plus unrelated plugins. None of them invalidate this change, the branch is still mergeable, and the head is unchanged (184b85a), so history was not rewritten. The stacked fork branch for the Galaxy full chapter index sits on an earlier point of this branch and is untouched.Not closed
Verification evidence
First pass
npm run check:pluginshows popular 20 ✅, search 1 ✅, parseNovel 30 chapters ✅, parseChapter 13258 chars ✅ (was a 404).lightnovelwpfix was reproduced independently on a reachable source, TC & Sega:parseChapterFAIL (0 chars) → PASS 5905 chars.lightnovelwpsources before and after showed exactly one status change (TC & Sega, FAIL → PASS). 20madarasources were identical, and 12madarasources swept for the metadata fallbacks showed no status or body-length change.kolnovel.comandfree.kolnovel.comtime out over TCP from the test machine. They were verified by running the plugin's own extraction on live HTML fetched through a text proxy, which gave 14002 chars from the same chapter on both hosts. On a 12-paragraph sample, the old regex returned 0 chars and the new selector returned 1,006. The sites themselves are up; only that network route times out.8522c771) atdc58567e: Galaxy NovelsparseChapterwent from FAILCould not reach site (404)to PASS with 49,502 chars, and RiwyatparseNovelwent from FAILMissing novel nameto PASS with full metadata, 100 chapters and a 9,002-char chapter body.KnoxT,ArNovel,LightNovelHeavenandNinjaidentical on head and base.UniversalNovelandMostNovelfail the same way on both, so those failures existed before this PR.Strengthening pass (head
184b85avsdc58567)Fixture before/after, calling the bundled plugins'
parseChapter:dc58567184b85a.text-leftholding only<img>(master returned the images)""<img>paragraphs""Chapter text not found on the page, try to open in webview..epcontent""<article class="epcontent">chapter<p>Content not available.</p>Chapter text not found on the page, open it in WebView.Full regression sweep over all 78
madaraand 36lightnovelwpsources plus Galaxy Novels. Every HTTP response was recorded once and replayed to both heads, so both saw identical pages. For each source the sweep ran popular → first novel → first chapter and compared status, name, author, genres, status, rating, summary length, cover, chapter count, body length and a hash of the body. 115 of 115 were identical. Reachability from the test machine:On every reachable
lightnovelwpchapter, the text extracted by the old regex and by this PR's selector was identical. Only the HTML serialization differs. On every reachable classicmadarachapter,.text-leftholds the text, so the selector walk still stops at.text-left, as it did before.npm run check:pluginon184b85a:fetch failed, TCP timeout on the test machine's route), still verified through a proxy onlynpm run build:compileexits 0.eslintandprettier --checkpass on all changed files.Re-verified 2026-09-28 (head
184b85a, no code changes)Direct probes:
galaxynovels.comHTTP 200,cenele.comHTTP 200,kolnovel.comandfree.kolnovel.comTCP timeout on 443 (fetch failed),markazriwayat.comHTTP 403 (Cloudflare challenge; reader proxy shows "Coming Soon").npm run check:plugin -- plugins/arabic/galaxynovels.ts): popular 20 ✅, search 1 ✅, parseNovel 30 chapters ✅, parseChapter 49502 chars ✅.npm run check:plugin -- "plugins/arabic/Riwyat[madara].ts"): popular 12 ✅, search 1 ✅, parseNovel ❌ FAIL "No chapters returned" — the harness checks the first popular novel (cont/pain-novel/), whose ownajax/chapters/endpoint currently answers "Manga has no chapter yet", so the site itself lists zero chapters there. Targeted runs on novels that have chapters still pass:cont/i-can-see-through-e/→ 120 chapters, full metadata (author, genres, Ongoing status, rating 8.4, cover, 905-char summary), first-chapter body 9,011 chars;cont/starting-over/→ 70 chapters, first-chapter body 634 chars.npm run check:pluginon both generated plugins):siteReachability(fetch failed) — the direct route still times out, so end-to-end verification remains impossible from here. Proxy re-verification on live HTML: the sampled Kol chapter (Chrysalis 162) serves<div class="epcontent entry-content">with nobottomnav; the old regex returns 0 chars and this PR's$('.epcontent').first().find('p')selector returns 29,415 chars (254 paragraphs). The Free novel page still lists chapter links as absolutekolnovel.comURLs, and the path normalization was unit-verified (old:free.kolnovel.com/https://kolnovel.com/…, new:/…); the same Free chapter's content was confirmed present through a reader proxy.npm run check:plugin -- plugins/arabic/Markazriwayat.ts):npm run build:compileexits 0;eslintandprettier --checkpass on all changed files.This PR was written by AI coding agents working for the PR author (the strengthening pass by Claude Opus 5.5, this description refresh by Muse Spark). No human has reviewed the code, so please review it with that in mind.