Skip to content

Commit

Permalink
FIx GourmetScans: fix getting pages
Browse files Browse the repository at this point in the history
Fixes #7322

Same fix than Haruneko
  • Loading branch information
MikeZeDev authored Aug 11, 2024
1 parent 78381c7 commit 4d3f7ba
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions src/web/mjs/connectors/GourmetScans.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,29 @@ export default class GourmetScans extends WordPressMadara {
const url = new URL(chapter.id, this.url);
const request = new Request(url, this.requestOptions);
const script = `
new Promise((resolve, reject) => {
try {
let rocketscript = new RocketLazyLoadScripts;
rocketscript._loadEverythingNow();
} catch (error) {}
setTimeout(() => {
var imgdata = JSON.parse(CryptoJS.AES.decrypt(chapter_data, wpmangaprotectornonce, {
format: CryptoJSAesJson
}).toString(CryptoJS.enc.Utf8));
resolve(JSON.parse(imgdata));
}, 2500);
new Promise( (resolve, reject) => {
let tries = 0;
const interval = setInterval(function () {
try {
if (CryptoJS) {
clearInterval(interval);
let imgdata = JSON.parse(CryptoJS.AES.decrypt(chapter_data, wpmangaprotectornonce, {
format: CryptoJSAesJson
}).toString(CryptoJS.enc.Utf8));
resolve(JSON.parse(imgdata));
}
} catch (error) {
clearInterval(interval);
reject(error);
} finally {
tries++;
if (tries > 10) {
clearInterval(interval);
reject(new Error('Unable to get pictures after more than 10 tries !'));
}
}
}, 1000);
window.dispatchEvent(new KeyboardEvent('mousemove'));
});
`;
const data = await Engine.Request.fetchUI(request, script);
Expand Down

0 comments on commit 4d3f7ba

Please sign in to comment.