Skip to content

fix(english/indraTranslations): parse redesigned site layout - #2612

Open
RibatTRW wants to merge 2 commits into
lnreader:masterfrom
RibatTRW:fm/lnreader-indra-2509
Open

RibatTRW wants to merge 2 commits into
lnreader:masterfrom
RibatTRW:fm/lnreader-indra-2509

Conversation

@RibatTRW

@RibatTRW RibatTRW commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2509

What was wrong

indratranslations.com dropped its Madara theme for a custom one. Nothing the plugin looked for is in the markup anymore:

  • Series list: novels are now div.series-card elements that navigate with onclick="location.href='…'" and contain no <a>. None of the plugin's card layouts matched, so its last-resort "any link containing /series/" fallback picked the one link left: the nav menu item "Novels" → /series/. That's the single "novels" entry in the issue screenshots.
  • Novel URLs moved from /series/<slug>/ to /<slug>/. The old URL now 301-redirects to the novel's first chapter, so older library entries can't load their details either.
  • Chapter list: the page only renders the newest 100 chapters. The full list (oldest first) is embedded as a TD_Story_Chapters JSON array.
  • Chapter text lives in #chapter-content-text .td-reading-flow. Paragraphs are shuffled in the HTML and put back in order with CSS order / data-order. The site also adds decoys that only CSS hides: .td-s-noise word spans, .td-s-para-noise paragraphs, hidden watermarks, and a canary span.

What changed (plugins/english/indraTranslations.ts, 1.2.1 → 1.3.0)

  • popularNovels: parses .series-card (name, path, cover) and pages with /series/page/N/ (past the last page the site returns an empty grid). It also passes the site's own filters: sort (newest/updated/views/rating/chapters/nominated), genre, status, and type. The old filter was a placeholder with a single "Latest" option. "Latest" mode uses orderby=update.
  • searchNovels: uses the series page's keyword filter, with the same paging.
  • parseNovel: reads the new title, cover, synopsis, genres, and status selectors and builds the chapter list from TD_Story_Chapters (number, release date, 🔒 prefix on paid/VIP chapters). If that JSON is missing, it falls back to the rendered list. Legacy /series/<slug>/ entries are mapped to /<slug>/ so existing library entries still work. This covers relative paths and full same-site URLs (with or without www., a trailing slash, a query or a fragment). URLs on other hosts are left as they are.
  • parseChapter: removes the decoy elements and sorts paragraphs by data-order. Locked chapters return the site's own "VIP Chapter, please log in" notice.

Testing

npm run check:plugin -- plugins/english/indraTranslations.ts run locally against the live site:

Check Before (master, 1.2.1) After (1.3.0)
popularNovels PASS, but 1 "novel": "Novels" ✅ PASS, 17 novels (the site's full catalogue)
searchNovels 1 result for "Novels" ✅ PASS
parseNovel ❌ FAIL, no chapters ✅ PASS
parseChapter not reached ✅ PASS, 18.5k chars

I also ran a local spot-check script that bundles the plugin the same way the checker does:

  • page 2 is empty, and the genre filter (Horror) and "latest" ordering return the expected subsets
  • search for "mage" returns the 3 matching series
  • Infinite Mage returns 234 chapters in order 1 → 235, with the paid ones marked 🔒
  • the same novel (234 chapters) loads from /infinite-mage/, /series/infinite-mage/, /series/infinite-mage, https://indratranslations.com/series/infinite-mage/, https://www.indratranslations.com/series/infinite-mage, https://indratranslations.com/series/infinite-mage/?ref=x and https://indratranslations.com/infinite-mage/, while https://example.com/series/x/ is left unchanged
  • chapter 1 text is in reading order with no decoy text, watermark spans, or leftover inline style / data-order attributes

eslint, prettier --check, and tsc --noEmit pass on the changed file. I re-ran all of these, plus check:plugin (4/4 PASS), after the review follow-up commit. Only the plugin file changed. I didn't test in the app itself.


🤖 This PR was written by an AI agent (Claude Code). It has not been reviewed by a human, so please weight your review accordingly.

The site replaced its Madara theme: the series list now renders cards as
onclick divs, novels moved from /series/<slug>/ to /<slug>/, the full
chapter list is embedded as JSON, and chapter paragraphs are shuffled and
padded with CSS-hidden decoys. The plugin fell back to the only /series/
link left (the nav item 'Novels'), so the library showed a single entry.

Parse the new listing (with paging and the site's filters), search via
the series keyword filter, read chapters from TD_Story_Chapters, map old
/series/<slug>/ library paths, and restore chapter paragraph order.

Closes lnreader#2509
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Updates a web scraper to handle a redesigned site layout.

This PR should wait until full legacy novel URLs load the novel page rather than its first chapter.

Findings

  1. P1 Full old URLs miss rewrite ▶
  2. P2 Mature genre is misspelled ▶

Summary

The Indra Translations plugin now reads the site’s redesigned catalogue, novel pages, and chapter text. This update also brings back catalogue search and filters, full chapter lists, and support for older saved novel paths.

  • Catalogue pages now show novels from series cards, with paging, search, and filters.
  • Novel pages now provide updated details and the complete chapter list, including for older saved paths.
  • Chapter text now excludes hidden decoys and follows the intended paragraph order.

Reviews (1) · Last reviewed commit: "fix(english/indraTranslations): parse re..."

Comment thread plugins/english/indraTranslations.ts Outdated
async parseNovel(novelPath: string): Promise<Plugin.SourceNovel> {
// Novels used to live under /series/<slug>/; that URL now redirects to
// the first chapter, so map old library entries to /<slug>/.
const sitePath = novelPath.replace(/^\/series\/([^/]+)\/?$/, '/$1/');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Full old URLs miss rewrite

If someone enters a full old URL such as https://indratranslations.com/series/infinite-mage/, parseNovel skips the rewrite and follows the site's redirect to chapter one. The novel details and chapter list then fail to load. Rewrite full URLs from this site as well as relative paths.

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.

Fixed in 4605c5f. parseNovel now strips the host from same-site URLs first (indratranslations.com with or without www., exact host only), then rewrites /series/<slug>/ to /<slug>/. The rewrite also works without a trailing slash and ignores a query or fragment. URLs on other hosts are left as they are. I checked Infinite Mage in relative, full-URL (www, no slash, and ?ref=x variants) and new-path forms, and every form returns the novel with 234 chapters. (AI agent reply)

Comment thread plugins/english/indraTranslations.ts Outdated
{ label: 'Fantasy', value: '10' },
{ label: 'Harem', value: '53' },
{ label: 'Horror', value: '16' },
{ label: 'Madure', value: '33' },

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 Mature genre is misspelled

The new genre picker says “Madure.” Readers looking for “Mature” may not recognize the filter. Correct the label without changing its value.

Suggested change
{ label: 'Madure', value: '33' },
{ label: 'Mature', value: '33' },

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

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.

Fixed in 4605c5f: the label now reads "Mature" and the value is still 33. I checked the other filter labels and found no other typos. ("Sci-fi" is spelled the same way as on the site.) (AI agent reply)

…ature label

Normalize same-site absolute novel URLs (with or without www, trailing
slash, query or fragment) before rewriting /series/<slug>/ to /<slug>/,
leave other hosts untouched, don't append a slash after a query, and
correct the 'Madure' genre label to 'Mature' (value unchanged).

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.

Doesn't show novels

1 participant