Skip to content

Commit

Permalink
FIX Mangarawto pages order (#6065)
Browse files Browse the repository at this point in the history
Somehow fetching image nodes by injecting a script fixes messed up image order and format

Fixes #6064
  • Loading branch information
MikeZeDev authored Aug 1, 2023
1 parent d101d9c commit 1b78c7d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/web/mjs/connectors/Mangarawto.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,20 @@ export default class Mangarawto extends Manga9 {
canHandleURI(uri) {
return /^mangaraw\.(to|vip|io)$/.test(uri.hostname);
}
}

async _getPages(chapter) {
const script = `
new Promise(resolve => {
let pagelist = [...document.querySelectorAll('div.card-wrap img')].map(element => {
return new URL(element.dataset.src, window.location).href
});
resolve(pagelist);
});
`;
const request = new Request(new URL(chapter.id, this.url), this.requestOptions);
const data = await Engine.Request.fetchUI(request, script);
return data.map(image => this.createConnectorURI(image));

}

}

0 comments on commit 1b78c7d

Please sign in to comment.