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.
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
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.
…/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 the theme dropped, and hard-coded a<div>wrapper where the theme serves<article>kolnovel.comso the plugin requestedfree.kolnovel.com/https://kolnovel.com/…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
npm run check:plugin— popular 20 ✅, search 1 ✅, parseNovel 30 chapters ✅, parseChapter 13258 chars ✅ (was a 404).lightnovelwpfix was independently reproduced on a reachable source, TC & Sega:parseChapterFAIL (0 chars) → PASS 5905 chars.lightnovelwpsources before and after — exactly one status change (TC & Sega, FAIL → PASS); 20madarasources identical; 12madarasources swept for the metadata fallbacks with no status or body-length change.kolnovel.comandfree.kolnovel.comrefuse 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 onenpm run check:pluginrun from a network that can reach the server.npm run build:compileexit 0; the lint and format findings are pre-existing onmaster, in files this PR does not touch.Not closed