diff --git a/src/web/mjs/connectors/KissAway.mjs b/src/web/mjs/connectors/KissAway.mjs index 4e58202b5b..b1a627559e 100644 --- a/src/web/mjs/connectors/KissAway.mjs +++ b/src/web/mjs/connectors/KissAway.mjs @@ -11,10 +11,18 @@ export default class KissAway extends FlatManga { this.requestOptions.headers.set('x-referer', this.url); } + generateRandomStr(length) { + const charmap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + let result =''; + for (let o = 0; o < length; o++) result += charmap.charAt(Math.floor(Math.random() * charmap.length)); + return result; + } + async _getChapters(manga) { + const randomStr = this.generateRandomStr(25); const script = ` new Promise(async resolve => { - const uri = new URL('app/manga/controllers/cont.listChapter.php', window.location.origin); + const uri = new URL('${randomStr}.lstc', window.location.origin); uri.searchParams.set('slug', dataL); const response = await fetch(uri); data = await response.text(); @@ -37,21 +45,21 @@ export default class KissAway extends FlatManga { async _getPages(chapter) { const uri = new URL(chapter.id, this.url); + const randomStr = this.generateRandomStr(30); const script = ` new Promise(async resolve => { const chapId = document.querySelector('input#chapter').value; - const uri = new URL('app/manga/controllers/cont.listImg.php', window.location.origin); + const uri = new URL('${randomStr}.iog', window.location.origin); uri.searchParams.set('cid', chapId); const response = await fetch(uri); const data = await response.text(); const dom = new DOMParser().parseFromString(data, "text/html"); const nodes = [...dom.querySelectorAll('img.chapter-img')]; - resolve(nodes.map(picture => picture.src)); + resolve(nodes.map(picture => picture.src).filter(image => !image.match(/olimposcan/))); }); `; const request = new Request(uri, this.requestOptions); const data = await Engine.Request.fetchUI(request, script); return data.map(link => this.createConnectorURI(link)); } - }