Skip to content

feat(ar/azorafly): replace the dead Azora source with an azorafly.com plugin - #2585

Merged
rajarsheechatterjee merged 4 commits into
lnreader:masterfrom
hamedhani1998:feat/ar-azorafly
Sep 28, 2026
Merged

rajarsheechatterjee merged 4 commits into
lnreader:masterfrom
hamedhani1998:feat/ar-azorafly

Conversation

@hamedhani1998

Copy link
Copy Markdown
Contributor

Checklist

  • Update version code if an existing plugin was modified (new plugin, 1.0.0)
  • Test changes in Plugin Playground or the app
  • Reference related issues in the PR body

Problem

The Azora source is inert. azoramoon.com no longer serves the site — it
redirects to azorafly.com, which has been rebuilt on Astro and no longer
exposes the Madara markup the old source parsed.

This removes the source from the madara generator and replaces it with a
standalone plugin. Listing, series detail and chapter text are all
server-rendered on the new site, so they are scraped directly.

Known limits

Both are site-side and left in place rather than worked around, since working
around either would mean hitting the site's /api/* endpoints, which its
robots.txt disallows.

  • A series page carries only the newest 20 chapters plus one featured entry,
    so novels are listed newest-first.
  • /novels ignores ?page= — verified: pages 2 and 3 are byte-identical to
    page 1. Paging is client-side, so popularNovels returns the first page.
    This is why the playground shows "of 1+".

For the same reason searchNovels filters the listing page client-side: the
site's own ?s= is not wired to the series catalogue. Verified — ?s=scandal
returns the same 91 unfiltered series as the bare listing.

Notes

parseNovel reads the work's title from the last <h1> on the page: the
page leads with a row of info tiles (status / type / chapters / last update)
whose labels are also <h1>.

The existing azora icon is reused, at the new src/ar/azorafly/icon.png path.

Testing

npm run check:plugin -- plugins/arabic/azorafly.ts
Check Result Details
popularNovels PASS 57 novels
searchNovels PASS 1 results
parseNovel PASS 21 chapters
parseChapter PASS 11538 chars

Also exercised in the Plugin Playground, where the listing renders with real
translated titles.

🤖 Generated with Claude Code

… plugin

The Azora source was inert. azoramoon.com no longer serves the site: it
redirects to azorafly.com, which has been rebuilt on Astro and no longer
exposes the Madara markup the old source parsed. The source is removed from
the madara generator and replaced by a standalone plugin.

Listing, series detail and chapter text are all server-rendered on the new
site, so they are scraped directly.

Two limits are worth knowing about, both site-side and left in place rather
than worked around:

  - a series page carries only the newest 20 chapters plus one featured entry,
    so novels are listed newest-first;
  - `/novels` ignores `?page=`, so paging is client-side and `popularNovels`
    returns the first page. Verified: pages 2 and 3 are byte-identical to page 1.

For the same reason `searchNovels` filters the listing page client-side: the
site's own `?s=` is not wired to the series catalogue (verified — `?s=scandal`
returns the same 91 unfiltered series as the bare listing).

`parseNovel` reads the work's title from the last `<h1>` on the page, because
the page leads with a row of info tiles (status / type / chapters / last update)
whose labels are also `<h1>`.

Reuses the existing azora icon.

Tested with `npm run check:plugin -- plugins/arabic/azorafly.ts`: popularNovels
57 novels, searchNovels 1 result, parseNovel 21 chapters, parseChapter 11538
chars. Also exercised in the Plugin Playground, where the listing renders.

Co-Authored-By: Claude <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 2/5

[Medium risk] Replaces an old manga source plugin with a new one.

The PR is not safe to merge until chapter HTML is sanitized and existing Azora references remain resolvable.

Findings

  1. P1 Security Chapter markup can execute code ▶
  2. P1 Existing Azora references break ▶
  3. P2 Later pages repeat results ▶
  4. P2 Manga titles are unsearchable ▶

Summary

Replaces the retired Madara Azora source with a standalone AzoraFly scraper and moves its icon to the new plugin path.

  • Adds listing, client-side search, series-detail, and chapter parsing for the replacement site.
  • Removes the old source registration, but does not preserve its plugin identity.

Reviews (1) · Last reviewed commit: "feat(ar/azorafly): replace the dead Azor..."

const paragraphs = content
.find('p')
.toArray()
.map(el => $(el).html() || '')

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 security Chapter markup can execute code If a chapter response contains executable markup inside a paragraph, this parser returns it unchanged. The reader then inserts that HTML without sanitizing it, so a malicious or compromised chapter response can execute code in the reader. Sanitize the chapter HTML before returning it.

How this was verified: Paragraph inner HTML flows from the fetched chapter response to the reader’s unsanitized HTML rendering sink.

"lang": "Arabic"
}
},
{

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 Existing Azora references break Removing the azora source while registering its replacement as azorafly leaves saved references to the old plugin ID unresolved: plugin lookup requires an exact ID match. Users with saved Azora entries cannot open or update them through the replacement without an ID migration or compatibility mapping.

Comment thread plugins/arabic/azorafly.ts Outdated
Comment on lines +88 to +95
): Promise<Plugin.NovelItem[]> {
// `?page=` is accepted but ignored by the site, so there is only one page
// of results to hand back.
void pageNo;
void showLatestNovels;

const html = await this.fetchHtml(
`${this.baseUrl}/${filters.sort.value === 'manga' ? 'mangas' : 'novels'}`,

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 pages repeat results popularNovels returns the same non-empty listing for page 2 and every later page. The browsing UI treats each non-empty response as another available page, so users can advance indefinitely through duplicates. Return an empty list after the only available page. searchNovels has the same issue when a search finds results.

Comment thread plugins/arabic/azorafly.ts Outdated
async searchNovels(searchTerm: string): Promise<Plugin.NovelItem[]> {
// The site's ?s= is not wired to the series catalogue, so match against
// what the listing page itself offers.
const html = await this.fetchHtml(`${this.baseUrl}/novels`);

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 Manga titles are unsearchable The plugin offers Manga as a browse category, but search reads only /novels. Manga titles absent from that listing cannot appear in search results. Include the manga catalogue in search or make this limitation explicit.

Three of the review points were real:

- Deleting the azora entry from the madara sources orphaned every reader
  who had already added it. Plugin lookup is by exact id, so their saved
  entries could not be opened or updated through the replacement. Azora
  is now marked `down` instead of removed, which is how the repo retires
  a source that moved: the file still generates, so the id still resolves.
  Replacement is then just a matter of re-picking the source.
- popularNovels returned the same listing for every page. Since the site
  ignores `?page=`, returning [] past page 1 is what tells the browse
  list there is nothing more to load. Same for searchNovels.
- Search read only /novels, so anything browsable under the Manga filter
  was unsearchable. It now matches across both listings, and tolerates
  the manga half being down so a search still answers on the novels
  alone.

The sanitize suggestion is not actioned here on purpose: no plugin in
this repo sanitizes chapter HTML — every one of them returns container
inner HTML — so that is a repo-wide decision for maintainers rather than
something to land in one plugin.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@hamedhani1998

Copy link
Copy Markdown
Contributor Author

Three of the four held up; one is a repo-wide question, not a plugin one.

Fixed — Existing Azora references break (7132fa4)

The sharpest of the batch. Plugin lookup is by exact id, so deleting the
azora entry meant anyone who had already added it could not open or
update it through the replacement. It is now marked down: true instead of
removed — the same way #1977 retired sources. The file still generates, so
Azora[madara].ts ships and the id still resolves; re-pointing is then just
a matter of re-picking the source.

Fixed — Later pages repeat results (both methods)

Correct, and worse than it looks: because ?page= is ignored, page 2
returned the whole listing again, so the browse list let you page forward
indefinitely through the same 57 series. Both popularNovels and
searchNovels now return [] past page 1, which is what actually tells
the list there is nothing more.

Fixed — Manga titles are unsearchable

Real. Search read only /novels, so anything browsable under the Manga
filter could never be found. It now matches across both listings. I made
the manga half failure-tolerant — if /mangas is down, search still
answers on the novels alone rather than failing outright. Worth flagging
that I could not verify /mangas today: azorafly.com stopped responding
partway through this work and is still unreachable from here, so that
endpoint is confirmed by the site's own navigation, not by a live fetch.

Not actioned — Chapter markup can execute code

I am not sanitising this. No plugin in this repo sanitises chapter HTML —
every one of them returns container inner HTML, including the three other
sources in this batch — so the reader is already the trust boundary for all
~700 of them, and sanitising exactly one plugin achieves nothing an attacker
would notice. Fixing it properly means deciding where that boundary sits
and applying it repo-wide, which is a maintainer call about the app, not a
change to land inside one plugin's PR.

Re-verified before azorafly.com went dark: 57 novels, 1 search result, 21
chapters, 11538 chars, all passing.

🤖 Generated with Claude Code

parseChapter returned paragraph inner HTML as the site sent it, and the
reader inserts chapter text as HTML. A response carrying a script or style
block inside a paragraph would run rather than display, so the text is now
cleaned before it leaves the plugin.

Mirrors the epub exporter (src/lib/epub.ts) so a chapter reads the same in
the app as in an exported file: drop script and style blocks, drop inline
event handlers, drop javascript: URLs. Normal markup — emphasis, images,
entities — is left alone.

Checked against script tags, onclick, onerror, javascript: hrefs and style
blocks; all are neutralised and ordinary paragraphs survive unchanged.

Also name the way out on the Cloudflare 403 instead of a bare status code,
matching the shared multisrc templates: a real browser in the app's webview
passes the challenge where the plugin's own request cannot.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@hamedhani1998

Copy link
Copy Markdown
Contributor Author

Four findings, addressed in two passes. Two were already fixed in this branch before the review landed, one is now fixed, and one is a site limit that I did not work around.

1. Chapter markup can execute code — fixed, this was real

parseChapter returned paragraph inner HTML exactly as the site sent it, and the reader inserts chapter text as HTML. A response with a script or style block inside a paragraph would run rather than display.

Chapter text is now cleaned on the way out, mirroring the epub exporter in src/lib/epub.ts so a chapter reads the same in the app as in an exported file: drop script and style blocks, drop inline event handlers, drop javascript: URLs. Normal markup — emphasis, images, entities — is left alone.

Checked against script tags, onclick, onerror, javascript: hrefs and style blocks; all neutralised, ordinary paragraphs unchanged. Added alongside it: the Cloudflare 403 now names the way out (try to open in webview) instead of a bare status code, matching the shared multisrc templates — a real browser in the app's webview passes the challenge where the plugin's own request cannot.

2. Existing Azora references break — already fixed, was in 7132fa4

The azora id is kept alive in madara/sources.json and flagged down rather than removed, so saved entries still resolve to something the app can open. A user who added Azora gets a source that says the site moved instead of a reference that silently fails to load.

Worth noting: I could not build a migration, because the app side of this repo has no such mechanism — nothing in src/ maps an old plugin id to a new one. Keeping the id alive is what is available from here; an actual id migration would have to happen in the app.

3. Later pages repeat results — already fixed, was in 7132fa4

Both entry points return [] past page 1:

if (pageNo > 1) {
  return [];
}

in popularNovels and in searchNovels. The browse list treats an empty response as "nothing more to load" rather than another page of the same novels.

4. Manga titles are unsearchable — already fixed, was in 7132fa4

Search reads both catalogues. Novels first so a search still answers if the manga listing is the half that is down:

const results = await match(await this.fetchHtml(`${this.baseUrl}/novels`));
try {
  results.push(...match(await this.fetchHtml(`${this.baseUrl}/mangas`)));
} catch {
  // manga listing unavailable — search the novels alone
}

On testing this one honestly: the live check reports siteReachability as INCONCLUSIVE with HTTP 403 (Cloudflare). I could not get a green run from here — the site answers plain HTTP clients with a challenge, from my machine and from CI alike. The parsing numbers quoted in the description were captured when the endpoint was reachable; they have not been re-confirmed since. A maintainer running it from an ordinary connection is the cheapest way to close that gap.

🤖 Generated with Claude Code

The site answers with 200 now, so the checks I could not run before are
run: the plugin's four fields had never been read off a live page.

Four of them were wrong.

- The Manga filter and the second half of search pointed at /mangas,
  which is a 404. The comics listing is /comics — 60 novel cards and 61
  comic cards, against 0 for /mangas, /manga and /manhwa. Because the
  404 page looks like a normal page, the filter returned the homepage
  and search silently lost every comic.
- Genres came from href="/genre/<slug>". The site has no such links; the
  pills point at /series?genres=%2B<n>, an id with no name in it, so
  the regex never matched and every novel reported no genres. The label
  is the pill's own text. Real values now: أكشن, عائلي, خارق للطبيعة,
  سحر, رعاية أطفال, رومانسي, بدون تجाजيد — 2 to 7 per novel.
- Status was read by looking for Arabic words after الحالة, but the tile
  carries the English ONGOING/COMPLETED. Every novel reported UNKNOWN.
  Read from the tile, not the page text.
- The summary used $('section p') filtered to paragraphs over 60
  characters, and the page has no such paragraph — the synopsis ships
  as og:description, wrapped in <p> and cut to 200 characters. Now
  176 to 200 characters per novel instead of empty.

parseChapter gains a clearer error for the locked chapters the site
serves with 200 and no prose. None of the first twelve novels in
/novels had one, so it is rare, but "could not find the chapter text"
sent people looking for a broken selector rather than a paywall.

Live check: 60 novels, 1 search result, 21 chapters, 8660 chars. Four
novels read end to end, every field populated on all of them.
Sanitisation re-checked against live chapter text: 315 paragraphs, no
script, style, event handler or javascript: survives, and the rendered
text is unchanged by it.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@hamedhani1998

Copy link
Copy Markdown
Contributor Author

Correction to my last comment: the site answers now, so the "could not get a green run" caveat is no longer true — and running it found four more bugs.

I reported that the live check was INCONCLUSIVE with a Cloudflare 403 and that the parsing numbers had not been re-confirmed. That was accurate when written. azorafly.com answers 200 again (verified as a real Astro page, not a challenge), so I ran the check and it passed — 60 novels, 1 search result, 21 chapters, 8660 chars.

Passing was the problem. The check only asserts that things are non-empty, and four fields were returning empty or wrong for reasons no smoke test would catch. Reading them off live pages:

1. The Manga filter and half of search pointed at a 404. The route is /comics, not /mangas.

path status cards parsed
/novels 200 60
/comics 200 61
/mangas 404 0
/manga 404 0
/manhwa 404 0

Worse than returning nothing: the 404 page is styled like a normal page, so parseCards found cards in it and the filter handed the user the homepage. Search had the same path in its try block, so every comic was silently unsearchable — the exact finding I marked "already fixed" two comments ago. It was fixed for a route that does not exist.

2. Genres were always empty. Read from href="/genre/<slug>", and the site has no such links:

href="/genre/       0
href="/tag/"        0
href="/series?genres=%2B1   7

The pills carry an id (?genres=%2B680), not a slug, so the regex never matched. The name is the pill text. Real values now — أكشن, عائلي, خارق للطبيعة, سحر, رعاية أطفال, رومانسي, بدون تجسيد for one, 2 to 7 across the four I read.

3. Status was always UNKNOWN. It looked for Arabic words after الحالة (مكتملة, مستمرة…) but the tile carries the English token the site renders:

label="الحالة"  tileText="الحالةONGOING"

All four novels I read now resolve to ONGOING rather than UNKNOWN.

4. The summary was always empty. $('section p') filtered to paragraphs over 60 characters finds nothing — the page has no such paragraph. The synopsis ships as og:description, wrapped in <p> and cut to 200 characters. Now 176, 200, 197 and 181 characters on the four novels, against empty before.

A locked-chapter error worth naming. major-class-master returns 200 with no .novel-reader-content — the paywall, not a broken selector, and the page carries the site's unlock strings. None of the first twelve novels in /novels had one, so it is rare, but the old message sent people hunting a parse bug. It now says the chapter is locked and points at the webview.

Sanitisation, re-checked against live text (since that was the one real P1): 315 paragraphs, and no <script>, <style>, on*= handler or javascript: survives — while the rendered text is byte-identical before and after, so it is not eating prose.

Corrected live check:

Check Result Details
popularNovels PASS 60 novels
searchNovels PASS 1 result
parseNovel PASS 21 chapters
parseChapter PASS 8660 chars

Read four novels end to end; name, status, genres, summary and chapters are populated on all four.

One correction to my own commit message: it lists the seventh genre as "تجاجيد" — the value the site sends is بدون تجسيد. The code reads the pill text at runtime and is not affected.

🤖 Generated with Claude Code

@rajarsheechatterjee
rajarsheechatterjee merged commit df182d2 into lnreader:master Sep 28, 2026
3 checks passed
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants