Skip to content

fix(english): rewrite BaiLianTales as standalone plugin for new site theme - #2664

Open
RibatTRW wants to merge 1 commit into
lnreader:masterfrom
RibatTRW:fm/lnreader-plugins-baliantales-2660
Open

RibatTRW wants to merge 1 commit into
lnreader:masterfrom
RibatTRW:fm/lnreader-plugins-baliantales-2660

Conversation

@RibatTRW

@RibatTRW RibatTRW commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2660

Why it broke

bailiantales.com no longer uses the Madara WordPress theme. Wayback snapshots from 2026-05-18 and 2026-08-26 still show themes/madara. The live site now runs its own theme (themes/jormuntl) with different listing, search, novel and chapter markup, and the Madara ajax/chapters/ endpoint now returns 404. The old madara-generated plugin still got HTTP 200 pages but matched none of its selectors, so the app showed "No result found".

There is no Cloudflare or User-Agent blocking involved: desktop Chrome, Android Chrome, okhttp and empty User-Agents all get the same 200 page with no challenge.

What changed

  • plugins/english/BaiLianTales.ts: a new standalone plugin for the current site.
    • It keeps the id bailiantales and the same path format (novel/<slug>/, novel/<slug>/<chapter>/), so existing library entries should keep resolving.
    • Version 2.2.0 → 2.3.0.
    • Popular / Latest: /novel/page/N/ with the site's own sort, status and genre filters. Popular defaults to "Recently Added" and Latest uses "Recently Updated". The site has no views-based sort, and its "Highest Rated" sort only lists rated novels (31 today).
    • Search: /page/N/?s=…. Paging past the last page returns an empty list instead of an error.
    • Novel: title, cover, status, genres and synopsis. The site shows 50 chapters per page, so the plugin also fetches the other ?toc_page=N pages.
    • Paid chapters: listed with 🔒 and can be hidden with a "Hide locked chapters" setting, the same pattern as fix(english/beastnovels): list premium chapters as locked #2656. Opening one gives a clear "locked" error instead of empty text.
    • Chapter text: strips the hidden anti-copy watermarks the site inserts ("[bailiantales.com]", "unauthorized copy", and HTML comments).
  • plugins/multisrc/madara/sources.json: removed the bailiantales entry.
  • The icon moved from public/static/multisrc/madara/bailiantales/ to public/static/src/en/bailiantales/ (pure rename).

Testing

  • npm run check:plugin -- plugins/english/BaiLianTales.ts: all four checks PASS against the live site. CI's Plugin Live Check also passed on this PR.
  • A local script ran the bundled plugin against the live site:
    • Popular pages 1–2 returned 21 + 21 novels; page 30 returned an empty list.
    • Latest uses the updated order. Combining status, genre and sort filters works.
    • Search "wife" returned 16 results on page 1, 11 on page 9 and none on page 10.
    • A 350-chapter novel returned 350 unique chapters across 7 TOC pages, in the site's order, 280 of them locked.
    • A 70-chapter novel returned chapters 1–70 across 2 pages, with no duplicates or gaps.
    • The hide-locked setting drops the locked rows. A locked chapter gives the "locked" error.
  • I checked 45 free chapters from 15 random novels; no watermark text was left.
  • The pipeline's own Test step could not run the playground because another process held port 3000, so it was skipped. The screenshots below come from a separate playground run.

Screenshots

These are from this repo's plugin playground, not the LNReader app. The Android toolchain isn't installed on the machine that made this change, so this fix has not been tested in the app. Port 3000 was taken by another process, so the playground ran on 3047. Its hard-coded proxy URL was pointed at that port through a temporary config outside the repo; no plugin or playground code was changed for this.

Popular (default filters):

Popular tab listing 21 BaiLianTales novels with covers

Latest:

Latest tab listing recently updated BaiLianTales novels

Search ("senior sister"):

Search results for "senior sister"

Novel detail (status, genres, summary, 350 chapters):

Parse Novel: Holding the Sword to Carry Away Senior Sister, Completed, 350 chapters

Chapter list (start of the list, then where the paid chapters begin):

Chapter list showing the first chapters
Chapter list showing locked chapters from Chapter 70

Chapter text:

Parse Chapter: chapter 1 text, 14284 characters

Not covered

  • Behaviour inside the LNReader app.
  • The site's volume-grouped chapter layout. None of the 405 novels currently listed uses it, so it isn't handled.

This PR was written by an AI agent (Claude), and the change and its 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** - skipped
  • ℹ️ No playground screenshot of the working fix could be captured. Port 3000 was taken by another process, so the playground ran on 3001 and its proxy request was blocked by CORS. The PR's screenshot requirement needs a rerun with port 3000 free.
  • Live validation: ✅ go - 4 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Popular novels listing returns novels from the redesigned site ✅ pass live check:plugin popularNovels: 21 novels
Search finds a novel by title ✅ pass live check:plugin searchNovels: 1 result
Novel page parses with its chapter list ✅ pass live check:plugin parseNovel: 26 chapters
Chapter page parses to readable content ✅ pass live check:plugin parseChapter: 22001 chars
Playground shows popular novels visually ⏸️ untested no The playground ran on port 3001 because port 3000 was held by another process, and its fetch proxy is tied to origin 3000. The browser blocked the request with a CORS error. Free port 3000 and rerun `…
  • npm run check:plugin -- plugins/english/BaiLianTales.ts (live bailiantales.com)
  • npm run dev:start playground, BaiLianTales selected and Fetch clicked in the browser
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…ite theme

BaiLianTales replaced its Madara theme with a custom WordPress theme, so the
madara multisrc template found no novels. Move the source out of madara into a
standalone plugin that parses the new listing, search, paged table of
contents and chapter pages, keeping the same plugin id and path format.

Fixes lnreader#2660
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium impact] Migrates a novel source plugin from shared template to standalone.

The PR appears safe to merge, with a non-blocking request to check novels whose chapters span multiple pages.

Findings

  1. P2 Later chapter pages lack coverage ▶

Summary

Replaces the old Madara-generated BaiLianTales source with a standalone plugin for the redesigned site.

  • BaiLianTales listings and searches follow the redesigned site.
  • BaiLianTales novels now include chapters and readable text.

RibatTRW acknowledged that working playground screenshots were not captured because port 3000 was occupied and the proxy caused a CORS error. This was not reported again.

Reviews (1) · Last reviewed commit: "fix(english/bailiantales): rewrite as st..." · Reviewed by Greptile

Comment on lines +141 to +146
const tocPages = $('#novel-toc .jt-page-jump option').length;
for (let page = 2; page <= tocPages; page++) {
const toc = await this.fetchPage(
this.site + novelPath + '?toc_page=' + page,
);
if (toc) chapters.push(...this.parseChapters(toc));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Later chapter pages lack coverage

The reported 26-chapter check never reaches this toc_page loop, since the first page holds 50 chapters. The existing live check accepts any nonempty chapter list, so missing later pages would still pass. Add a check using a novel with more than 50 chapters and confirm that chapters from the last page appear once and in the expected order.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked against the live site by running the bundled plugin outside check:plugin:

  • novel/holding-the-sword-to-carry-away-senior-sister-transmigration/ returned 350 chapters, all unique (7 TOC pages), from chapter-1 to the last row chapter-347 ("Chapter 347 – Extra 14"). The order is the site's own TOC order, including its non-sequential slugs such as chapter-23-2 and chapter-224_2.
  • novel/who-says-the-director-is-frigid-lily-abo/ returned 70 unique chapters (2 TOC pages) in ascending order. Row 50 is chapter-50, row 51 is chapter-51 and the last is chapter-70, so nothing is dropped or repeated at the page boundary.

The playground screenshots in the PR description also show the 350-chapter novel. I didn't add a dedicated multi-page check to the shared live-check tooling, because this PR is scoped to the plugin.

Reply written by an AI agent (Claude).

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.

Bailian Tales - Broken source due to website redesign

1 participant