Skip to content

Feat/wuxiadreams add new plugin#2169

Draft
7ui77 wants to merge 8 commits intolnreader:masterfrom
7ui77:feat/wuxiadreams
Draft

Feat/wuxiadreams add new plugin#2169
7ui77 wants to merge 8 commits intolnreader:masterfrom
7ui77:feat/wuxiadreams

Conversation

@7ui77
Copy link
Copy Markdown
Contributor

@7ui77 7ui77 commented May 5, 2026

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)

This PR adds a new plugin for Wuxia Dreams (wuxiadreams.com), apopular English novel site.

close #2159

@7ui77
Copy link
Copy Markdown
Contributor Author

7ui77 commented May 5, 2026

@K1ngfish3r Could you check if I need to improve my code at all?

Copy link
Copy Markdown
Collaborator

@K1ngfish3r K1ngfish3r left a comment

Choose a reason for hiding this comment

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

  1. image needs to be 96x96 pixels
  2. use URL method for constructing URLs https://developer.mozilla.org/en-US/docs/Web/API/URL, resolveURL is from a time when hermes did not support URL method
  3. the filters went poof for whatever reason
  4. the summary error is from a JSON parse error, wrapping in divs is not required
  5. the POST request can be made by adding novelId to the end of novel.path in parseNovels, novelId can be obtained from the cover url

you can request a review by clicking here (no suggestions for me as I am not PR creator)

Image

rather than closing the PR, you can convert to draft if you are still working on it, and request for review when done

): Promise<Plugin.NovelItem[]> {
let url = `${this.site}novels?page=${pageNo}`;

if (filters.sort?.value) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What happened to filters?

Comment on lines +87 to +88
// Wrap in <div> to prevent selector parsing errors on plain text
const summary = $('<div>' + (summaryElement.html() || '') + '</div>');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

summaryElement.html() is already from an html, this is not required as the response did not come from a json

Comment on lines +45 to +46
cover: this.resolveUrl(cover),
path: url.replace(/^\//, ''),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can use URL method instead

Comment on lines +138 to +153
novel.chapters = this.parseChapters($);

// Pagination
const lastPageLink = $('a[aria-label="Last page"]').attr('href');
if (lastPageLink) {
const match = lastPageLink.match(/page=(\d+)/);
if (match) {
novel.totalPages = parseInt(match[1], 10);
}
} else {
const pageText = $('div:contains("Page")').text();
const match = pageText.match(/Page\s+\d+\s+of\s+(\d+)/);
if (match) {
novel.totalPages = parseInt(match[1], 10);
}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can change to POST request, rather than fetching all these GETs, good for environment
but it'll involve smuggling novelId from parseNovels, which is possible

Comment on lines +14 to +17
private resolveUrl(path?: string) {
if (!path) return undefined;
return path.startsWith('http') ? path : this.site + path.replace(/^\//, '');
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can use URL method instead of this function

@7ui77 7ui77 marked this pull request as draft May 5, 2026 07:41
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.

Online novel reading plugin request

2 participants