Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: LeviatanScans - add WpMangaProtector bypass #5896

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/web/mjs/connectors/LeviatanScans.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ export default class LeviatanScans extends WordPressMadara {
return new Request(new URL(`/ranking/page/${page}/`, this.url), this.requestOptions);
}

async _getPages(chapter) {
return await this._getWProtectedPages(chapter);
}

async _getWProtectedPages(chapter) {
const url = new URL(chapter.id, this.url);
const request = new Request(url, this.requestOptions);
const script = `
new Promise((resolve, reject) => {
var imgdata = JSON.parse(CryptoJS.AES.decrypt(chapter_data, wpmangaprotectornonce, {
format: CryptoJSAesJson
}).toString(CryptoJS.enc.Utf8));
resolve(JSON.parse(imgdata));
});
`;
return await Engine.Request.fetchUI(request, script);
}

async _handleConnectorURI(payload) {
let request = new Request(payload.url, this.requestOptions);
request.headers.set('x-referer', payload.referer);
Expand Down