Skip to content

Fix missing / in Illusia URLs and restore broken parseNovel selectors - #2566

Closed
lucasaugustodeveloper wants to merge 2 commits into
lnreader:masterfrom
lucasaugustodeveloper:fix/urlBroken
Closed

lucasaugustodeveloper wants to merge 2 commits into
lnreader:masterfrom
lucasaugustodeveloper:fix/urlBroken

Conversation

@lucasaugustodeveloper

Copy link
Copy Markdown

Checklist

  • Update version code if an existing plugin was modified
  • Test changes in Plugin Playground or the app
  • Reference related issues in the PR body (e.g. Closes #xyz)
  • Commit messages follow type(scope): description (e.g. feat(<generator>): add new source)

Summary

This PR fixes three related problems found in the Portuguese plugins:

  1. Illusia (root cause of the reported bug): novel/chapter URLs were being built
    without a / after the domain, e.g.
    https://illusia.com.brstory/ldm-lorde-dos-misterio instead of
    https://illusia.com.br/story/ldm-lorde-dos-misterio/.
  2. Illusia (found during validation): parseNovel failed to extract the novel
    name, cover, and summary because the site switched to a new theme
    (illusia-single-story__* CSS classes), invalidating the old selectors.
  3. Blog do Amon Novels (found during validation): parseNovel returned zero
    chapters
    because the site changed its template — the #clwd element the plugin
    scraped for the series category label now only exists inside a <script> (built
    at runtime via JS), and is no longer part of the rendered DOM.

Root cause analysis

1. Illusia — missing / in URLs

The plugin normalized every novel/chapter path by stripping both the leading and
trailing slashes:

path: novelUrl
  .replace(this.site, '')
  .replace(/^\//, '')
  .replace(/\/$/, ''),
// => "story/ldm-lorde-dos-misterio"

The plugin also had no resolveUrl defined (an existing implementation was left
commented out at the bottom of the file). When a plugin does not implement
resolveUrl, the LNReader app falls back to a plain site + path concatenation,
producing:

"https://illusia.com.br" + "story/ldm-lorde-dos-misterio"
=> "https://illusia.com.brstory/ldm-lorde-dos-misterio"   // missing "/"

2. Illusia — outdated selectors after theme change

A live check against the site showed the current markup uses a custom Illusia theme:

  • Title: <h1 class="illusia-single-story__title"> (was h1.story__identity-title)
  • Cover: <img class="illusia-single-story__cover-img" data-src="...">
    (was figure.story__thumbnail img)
  • Summary: <div class="illusia-single-story__description">
    (was section.story__summary)

Author (a[href*="/author/"]), genres (div.tag-group > a), status
(span.story__status), chapter list (li.chapter-group__list-item), and chapter
content (section#chapter-content) were verified against the live pages and still
match, so they were left untouched.

3. Blog do Amon Novels — chapter list extraction broken

The old implementation derived the Blogger series label from the text of a #clwd
element:

const cat = loadedCheerio('#clwd').text().split("'")[1];

The site's new template builds #clwd dynamically via jQuery inside a <script>
tag, so it no longer exists in the raw HTML and cat became undefined, falling
into a branch that scraped a now-absent #chapters element and returned 0 chapters.

The new template declares the label inline in the page:

<script>
  let startIndex = 2;
  const maxResults = 30;
  const categoria = "Makio";
  ...
</script>

Fetching feeds/posts/default/-/{categoria}?alt=json with that extracted label
returns the full chapter feed (confirmed against the live site: 394 entries for the
tested novel).

Changes

plugins/portuguese/illusia.ts (1.0.2 → 1.0.3)

  • Enabled resolveUrl so paths keep their current normalized form and the app
    builds correct absolute URLs:
    resolveUrl = (path: string) => `${this.site}/${path}/`;
  • Updated parseNovel selectors (old ones kept as fallbacks):
    • name: added h1.illusia-single-story__title
    • cover: added img.illusia-single-story__cover-img (data-src first, since
      src holds an SVG lazy-load placeholder)
    • summary: added div.illusia-single-story__description

plugins/portuguese/blogdoamonnovels.ts (1.0.1 → 1.0.2)

  • Extract the series label from the inline script, keeping the old #clwd method
    as a fallback:
    const cat =
      /categoria\s*=\s*"([^"]+)"/.exec(body)?.[1] ??
      loadedCheerio('#clwd').text().split("'")[1];

Other plugins audited

The remaining plugins in plugins/portuguese/ were checked for the missing-slash
bug and do not have it, so they were left unchanged:

Plugin Affected? Why
tsundoku.ts No Paths keep the leading / (.replace(this.site, '')), so the app's site + path fallback already yields a valid URL
novelmania.ts No Paths always start with /novels/... and the plugin already implements resolveUrl

Testing

All four plugins in plugins/portuguese/ were exercised against their live sites
with npm run check:plugin:

Plugin popularNovels searchNovels parseNovel parseChapter
illusia.ts ✅ 10 novels ✅ 2 results ✅ 1437 chapters ✅ 18630 chars
blogdoamonnovels.ts ✅ 12 novels ✅ 1 result ✅ 95 chapters ✅ 12896 chars
tsundoku.ts ✅ 48 novels ✅ 1 result ✅ 115 chapters ✅ 881 chars
novelmania.ts ✅ 20 novels ✅ 2 results ✅ 6 chapters ✅ 32866 chars

URL construction verified in the check output:
https://illusia.com.br/story/ldm-lorde-dos-misterios/ (correct, with /).

ESLint and Prettier pass on both modified files with no warnings.

Note: plugins/portuguese/novelmania.ts has a pre-existing Prettier formatting
warning on the committed code. It was intentionally left untouched to keep this PR
focused.

@greptile-apps

greptile-apps Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no accepted new findings or outstanding blocking findings.

Summary

This PR repairs Portuguese source plugins affected by site-template and URL-construction changes.

  • Updates Illusia’s title, cover, and summary selectors while retaining legacy fallbacks.
  • Adds URL resolution for Illusia and now preserves lowercase HTTP(S) absolute URLs.
  • Extracts Blog do Amon Novels’ category from its inline script, retaining the former DOM-based fallback.
  • Increments both modified plugin versions.

Reviews (2) · Last reviewed commit: "Update plugins/portuguese/illusia.ts"

Comment thread plugins/portuguese/illusia.ts Outdated
@rajarsheechatterjee

Copy link
Copy Markdown
Member

This is superseded by the rewrite in #2567.

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@lucasaugustodeveloper
lucasaugustodeveloper marked this pull request as draft September 24, 2026 17:10
@lucasaugustodeveloper
lucasaugustodeveloper marked this pull request as ready for review September 24, 2026 17:10
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.

2 participants