From 8808a4f39685c0c225420255866f17b989ddc3c8 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Tue, 4 Jul 2023 19:30:39 +0000 Subject: [PATCH 1/3] FIX RealmScans: change url --- src/web/mjs/connectors/RealmScans.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/mjs/connectors/RealmScans.mjs b/src/web/mjs/connectors/RealmScans.mjs index 496c3a6d4d0..b7d01a184f7 100644 --- a/src/web/mjs/connectors/RealmScans.mjs +++ b/src/web/mjs/connectors/RealmScans.mjs @@ -7,7 +7,7 @@ export default class RealmScans extends WordPressMangastream { super.id = 'realmscans'; super.label = 'RealmScans'; this.tags = [ 'manga', 'english' ]; - this.url = 'https://realmscans.com'; + this.url = 'https://realmscans.xyz'; this.path = '/series/?list'; } async _getPages(chapter) { From ca210ab32a69216a74c55f28c791eb6cb9518896 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Wed, 5 Jul 2023 07:58:07 +0000 Subject: [PATCH 2/3] fix getting mangas list --- src/web/mjs/connectors/RealmScans.mjs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/web/mjs/connectors/RealmScans.mjs b/src/web/mjs/connectors/RealmScans.mjs index b7d01a184f7..65fd832b2e4 100644 --- a/src/web/mjs/connectors/RealmScans.mjs +++ b/src/web/mjs/connectors/RealmScans.mjs @@ -8,16 +8,35 @@ export default class RealmScans extends WordPressMangastream { super.label = 'RealmScans'; this.tags = [ 'manga', 'english' ]; this.url = 'https://realmscans.xyz'; - this.path = '/series/?list'; + this.path = '/series'; } + + async _getMangas() { + const request = new Request(new URL(this.path, this.url), this.requestOptions); + const script = ` + new Promise((resolve) => { + setTimeout(() => { + let mangalist = [...document.querySelectorAll('div.bsx a')].map(element => { + return { + id: element.pathname, + title: element.querySelector('div.tt').textContent.trim() + }; + }); + resolve(mangalist); + },2500); + }); + `; + return await Engine.Request.fetchUI(request, script); + } + async _getPages(chapter) { const data = await super._getPages(chapter); return data.map(element => this.createConnectorURI(element)); } async _handleConnectorURI(payload) { - let request = new Request(payload, this.requestOptions); + const request = new Request(payload, this.requestOptions); request.headers.set('x-referer', this.url); - let response = await fetch(request); + const response = await fetch(request); let data = await response.blob(); data = await this._blobToBuffer(data); this._applyRealMime(data); From 2b65bda5d21ef15fc743185010ef43818aec70a6 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Wed, 5 Jul 2023 09:54:42 +0000 Subject: [PATCH 3/3] Update RealmScans.mjs --- src/web/mjs/connectors/RealmScans.mjs | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/web/mjs/connectors/RealmScans.mjs b/src/web/mjs/connectors/RealmScans.mjs index 65fd832b2e4..5f3b9e31896 100644 --- a/src/web/mjs/connectors/RealmScans.mjs +++ b/src/web/mjs/connectors/RealmScans.mjs @@ -13,20 +13,13 @@ export default class RealmScans extends WordPressMangastream { async _getMangas() { const request = new Request(new URL(this.path, this.url), this.requestOptions); - const script = ` - new Promise((resolve) => { - setTimeout(() => { - let mangalist = [...document.querySelectorAll('div.bsx a')].map(element => { - return { - id: element.pathname, - title: element.querySelector('div.tt').textContent.trim() - }; - }); - resolve(mangalist); - },2500); - }); - `; - return await Engine.Request.fetchUI(request, script); + const data = await this.fetchDOM(request, 'div.bsx a'); + return data.map(element => { + return { + id: element.pathname, + title: element.querySelector('div.tt').textContent.trim() + }; + }); } async _getPages(chapter) {