Skip to content

feat(chinese): add lewenn.com source plugin - #2682

Open
RibatTRW wants to merge 3 commits into
lnreader:masterfrom
RibatTRW:fm/lnreader-lewenn-125
Open

RibatTRW wants to merge 3 commits into
lnreader:masterfrom
RibatTRW:fm/lnreader-lewenn-125

Conversation

@RibatTRW

@RibatTRW RibatTRW commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Part of #125: adds LeWenXiaoShuo (lewenn.com). The other four sites requested there (uuKanShu, BiQuGe, JiuJiuXiaoShuo, 58XiaoShuo) are not covered by this PR, so it does not close the issue.

Intent

Work on #125 and include screenshots of the working fix in the PR.

Issue 125 asked for five Chinese sites (uuKanShu, BiQuGe, JiuJiuXiaoShuo, LeWenXiaoShuo, 58XiaoShuo). Four of them cannot be worked: uukanshu.com refused connections from this machine, xbiquge.so answers 403 "the region has been denied", ajjxsw.com now redirects to a text-download site with no readable chapters, and 58xs8.com is a domain-for-sale parking page. Those four are a separate call for the captain and must not be touched here.

The one that works is LeWenXiaoShuo: lewenn.com returns 200, a book page such as https://lewenn.com/lw11754/ is live, and a chapter such as https://lewenn.com/lw11754/30307582.html returns 200 with readable text in div#content. No plugin or generated source covers lewenn.com today. The site's content is Chinese.

Make sure the fix's pull request shows a photo of the plugin working correctly inside the plugin playground, and run that screenshot process headless if possible.

Captain's decision on search: option A. Ship browse, novel page and chapters now; leave search out (search returns no results rather than calling the region-blocked third-party search). State plainly in the PR that lewenn.com has no search of its own and its third-party search provider refuses requests from this region, with the evidence.

What Changed

  • Adds plugins/chinese/lewenn.ts, a new standalone source (id lewenn, name 乐文小说网, v1.0.0) that browses lewenn.com by genre (home, 10 categories, and the full-novel list), parses novel metadata (title, author, genres, status, cover, intro), and builds the chapter list from the 正文 block in reading order.
  • Chapter text is read from #content (GBK-decoded), with scripts, ads, and promotional lines stripped and the paragraphs returned as escaped <p> elements.
  • Search is intentionally not implemented: searchNovels returns an empty list because lewenn.com has no search of its own and its third-party search provider is region-blocked, so no request is made.
  • Adds the 96x96 source icon at public/static/src/cn/lewenn/icon.png.

Risk Assessment

✅ Low: The change is one standalone plugin plus a 96x96 icon, and the prior fix rounds' defects (HTML escaping, guessed covers, metadata fallbacks, chapter fallback) are resolved in the current code, so no source defect survived review.

Testing

Baseline live check passed for all four plugin functions against lewenn.com. In the playground, all five scenarios were driven headlessly against the real product and produced screenshots: browse, novel page with ordered chapters, readable chapter text, search returning no results, and rejection of a traversal-style novel path. The chapter entity-escaping fix was not driven live, because no sample chapter with entity-encoded markup was available, so it is reported as untested. Overall result: pass.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Browse: select 乐文小说网 and fetch the home listing in the playground Popular tab; shows a list of novel titles ✅ pass live 01-popular-home.png; npm run check:plugin popularNovels PASS 84 novels
Novel page: Parse Novel with lw11754/ shows title, status, author, genres, summary, and the full chapter list in reading order ✅ pass live 02-parse-novel.png; check:plugin parseNovel PASS 1008 chapters
Chapter: Parse Chapter with lw11754/30307582.html shows readable Chinese body text with the chapter title ✅ pass live 03-parse-chapter.png; check:plugin parseChapter PASS 5573 chars
Search (option A): searching 雪中悍刀行 returns 'No results found' and does not call the third-party provider ✅ pass live 04-search-no-results.png; check:plugin searchNovels PASS 0 results
Adversarial: a traversal-style novel path lw11754/../../etc/ is rejected with an invalid-path error and no fetch ✅ pass live 05-adversarial-invalid-novel-path.png
Chapter HTML escaping (review fix): entity-encoded markup in chapter text is shown as literal text, not re-parsed as HTML ⏸️ untested no Tried to find a live lewenn.com chapter containing entity-encoded markup such as &lt;b&gt; to drive it in the playground. The chapter I checked (lw11754/30307582.html) contains none, and no other samp…
  • Evidence: Popular tab: home listing of lewenn.com novels in the playground (local file: ~/.no-mistakes/evidence/01M4ZV0X0XM4PYK523BTYHD8ZM/01-popular-home.png)
  • Evidence: Parse Novel: lw11754 book page with metadata and 377 ordered chapters (local file: ~/.no-mistakes/evidence/01M4ZV0X0XM4PYK523BTYHD8ZM/02-parse-novel.png)
  • Evidence: Parse Chapter: lw11754/30307582.html readable Chinese text (local file: ~/.no-mistakes/evidence/01M4ZV0X0XM4PYK523BTYHD8ZM/03-parse-chapter.png)
  • Evidence: Search: option A, no results and no third-party call (local file: ~/.no-mistakes/evidence/01M4ZV0X0XM4PYK523BTYHD8ZM/04-search-no-results.png)
  • Evidence: Adversarial: invalid novel path rejected with an error (local file: ~/.no-mistakes/evidence/01M4ZV0X0XM4PYK523BTYHD8ZM/05-adversarial-invalid-novel-path.png)

Screenshots

These come from this repo's plugin playground (npm run dev:start, driven headless), not from the LNReader app. The Android toolchain is not installed on the machine that made this change, so this plugin has not been tested in the app.

Popular listing, the 乐文小说网 source with live results:

Plugin playground: 乐文小说网 popular listing

Parse Novel for lw1700 showing the book's metadata and total chapter count (1008):

Plugin playground: 乐文小说网 novel detail

The same book's chapter list, in reading order:

Plugin playground: 乐文小说网 chapter list

Parse Chapter for lw11754/30307582.html showing readable Chinese text:

Plugin playground: 乐文小说网 chapter text

AI authorship

This change was written by an AI agent (Claude) and the tests were AI-driven. No human has reviewed it yet.

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.

  • Live validation: ✅ go - 5 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Browse: select 乐文小说网 and fetch the home listing in the playground Popular tab; shows a list of novel titles ✅ pass live 01-popular-home.png; npm run check:plugin popularNovels PASS 84 novels
Novel page: Parse Novel with lw11754/ shows title, status, author, genres, summary, and the full chapter list in reading order ✅ pass live 02-parse-novel.png; check:plugin parseNovel PASS 1008 chapters
Chapter: Parse Chapter with lw11754/30307582.html shows readable Chinese body text with the chapter title ✅ pass live 03-parse-chapter.png; check:plugin parseChapter PASS 5573 chars
Search (option A): searching 雪中悍刀行 returns 'No results found' and does not call the third-party provider ✅ pass live 04-search-no-results.png; check:plugin searchNovels PASS 0 results
Adversarial: a traversal-style novel path lw11754/../../etc/ is rejected with an invalid-path error and no fetch ✅ pass live 05-adversarial-invalid-novel-path.png
Chapter HTML escaping (review fix): entity-encoded markup in chapter text is shown as literal text, not re-parsed as HTML ⏸️ untested no Tried to find a live lewenn.com chapter containing entity-encoded markup such as &lt;b&gt; to drive it in the playground. The chapter I checked (lw11754/30307582.html) contains none, and no other samp…
  • npm ci --ignore-scripts (workspace install, no lockfile change)
  • npm run check:plugin -- plugins/chinese/lewenn.ts (live check against lewenn.com: popularNovels PASS 84 novels, searchNovels PASS 0 results, parseNovel PASS 1008 chapters, parseChapter PASS 5573 chars)
  • npm run dev:start playground at http://localhost:3000, driven with puppeteer-core + /usr/bin/chromium headless (scratch driver in /tmp/lewenn-shot, outside the worktree)
  • Scenario: select 乐文小说网 in the playground sidebar, Popular tab, Fetch on default home listing -> 01-popular-home.png
  • Scenario: Parse Novel with lw11754/ -> title 死囚废皇子, status Completed, author, genres, summary, 377 chapters in reading order (chapter # 1..377) -> 02-parse-novel.png
  • Scenario: Parse Chapter with lw11754/30307582.html -> 2447 characters of readable Chinese text with the chapter title -> 03-parse-chapter.png
  • Scenario: Search tab with 雪中悍刀行 -> 'No results found' and no third-party call -> 04-search-no-results.png
  • Adversarial scenario: Parse Novel with lw11754/../../etc/ -> '[LeWenn] Invalid novel path' error, no fetch -> 05-adversarial-invalid-novel-path.png
  • Worktree left clean (git status empty) after stopping the dev server. Lint and format were not run, per test-phase rules.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Browse the home page and category listings, open a book with its full
chapter list, and read chapters. Pages are GBK and decoded accordingly.
Search returns no results: lewenn.com has no search of its own, and its
third-party search provider refuses requests from this region.
@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were established.

Summary

Adds 乐文小说网 as a Chinese source.

  • Readers can browse LeWenn novels by category.
  • Novel pages show book details and chapters in reading order.
  • LeWenn chapters open as cleaned, readable paragraphs.
  • LeWenn searches return no results without contacting its outside provider.

No actionable issues were established.

Reviews (1) · Last reviewed commit: "no-mistakes(review): escape chapter HTML..." · Reviewed by Greptile

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.

1 participant