From dd280aa06d1626b670f3f523d9a93bf8594b5b72 Mon Sep 17 00:00:00 2001 From: MikeZeDev Date: Wed, 30 Aug 2023 07:01:40 +0000 Subject: [PATCH] FIX KomikCast: domain and getpages (#6168) * FIX KomikCast: domain and getpages Fixes https://github.com/manga-download/hakuneko/issues/6132 For some reason domain init fails with JS. * Update KomikCast.mjs * Update KomikCast.mjs --- src/web/mjs/connectors/KomikCast.mjs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/web/mjs/connectors/KomikCast.mjs b/src/web/mjs/connectors/KomikCast.mjs index 1a9eac480c4..d945418b071 100644 --- a/src/web/mjs/connectors/KomikCast.mjs +++ b/src/web/mjs/connectors/KomikCast.mjs @@ -7,12 +7,23 @@ export default class KomikCast extends WordPressMangastream { super.id = 'komikcast'; super.label = 'KomikCast'; this.tags = [ 'manga', 'indonesian' ]; - this.url = 'https://komikcast.io'; + this.url = 'https://komikcast.vip'; this.path = '/daftar-komik/?list'; this.queryMangas = 'div.text-mode_list-items ul li a.series, div.text-mode_list-items ul li a.text-mode_list-item'; this.queryChapters = 'div.komik_info-chapters ul li.komik_info-chapters-item a.chapter-link-item'; this.queryChaptersTitle = undefined; - this.queryPages = 'div.main-reading-area img[src^="http"], div.separator img[src^="http"]'; + this.queryPages = 'div.main-reading-area source[src^="http"], div.separator source[src^="http"]'; + } + + async _initializeConnector() { + // do nothing on purpose + } + + async _getPages(chapter) { + const uri = new URL(chapter.id, this.url); + const request = new Request(uri, this.requestOptions); + const data = await this.fetchDOM(request, this.queryPages); + return data.map(image => this.createConnectorURI(this.getAbsolutePath(image, request.url))); } }