diff --git a/lib-multisrc/iken/src/eu/kanade/tachiyomi/multisrc/iken/Iken.kt b/lib-multisrc/iken/src/eu/kanade/tachiyomi/multisrc/iken/Iken.kt index 3aa65fc92..bd5f65c3b 100644 --- a/lib-multisrc/iken/src/eu/kanade/tachiyomi/multisrc/iken/Iken.kt +++ b/lib-multisrc/iken/src/eu/kanade/tachiyomi/multisrc/iken/Iken.kt @@ -33,7 +33,7 @@ abstract class Iken( .set("Referer", "$baseUrl/") private var genres = emptyList>() - private val titleCache by lazy { + protected val titleCache by lazy { val response = client.newCall(GET("$baseUrl/api/query?perPage=9999", headers)).execute() val data = response.parseAs() diff --git a/src/en/infernalvoidscans/build.gradle b/src/en/infernalvoidscans/build.gradle index e73274067..4d19d4dce 100644 --- a/src/en/infernalvoidscans/build.gradle +++ b/src/en/infernalvoidscans/build.gradle @@ -1,9 +1,9 @@ ext { - extName = 'Infernal Void Scans' - extClass = '.InfernalVoidScans' - themePkg = 'mangathemesia' + extName = 'Hive Scans' + extClass = '.HiveScans' + themePkg = 'iken' baseUrl = 'https://hivetoon.com' - overrideVersionCode = 10 + overrideVersionCode = 36 } apply from: "$rootDir/common.gradle" diff --git a/src/en/infernalvoidscans/src/eu/kanade/tachiyomi/extension/en/infernalvoidscans/HiveScans.kt b/src/en/infernalvoidscans/src/eu/kanade/tachiyomi/extension/en/infernalvoidscans/HiveScans.kt new file mode 100644 index 000000000..03f375bcc --- /dev/null +++ b/src/en/infernalvoidscans/src/eu/kanade/tachiyomi/extension/en/infernalvoidscans/HiveScans.kt @@ -0,0 +1,38 @@ +package eu.kanade.tachiyomi.extension.en.infernalvoidscans + +import eu.kanade.tachiyomi.multisrc.iken.Iken +import eu.kanade.tachiyomi.source.model.MangasPage +import eu.kanade.tachiyomi.util.asJsoup +import okhttp3.Response + +class HiveScans : Iken( + "Hive Scans", + "en", + "https://hivetoon.com", +) { + + override val versionId = 2 + + override val client = super.client.newBuilder() + .addInterceptor { chain -> + val request = chain.request() + val headers = request.headers.newBuilder() + .set("Cache-Control", "max-age=0") + .build() + chain.proceed(request.newBuilder().headers(headers).build()) + } + .build() + + override fun headersBuilder() = super.headersBuilder() + .set("Cache-Control", "max-age=0") + + override fun popularMangaParse(response: Response): MangasPage { + val document = response.asJsoup() + + val entries = document.select(".group a").mapNotNull { + titleCache[it.absUrl("href").substringAfter("series/")]?.toSManga() + } + + return MangasPage(entries, false) + } +} diff --git a/src/en/infernalvoidscans/src/eu/kanade/tachiyomi/extension/en/infernalvoidscans/InfernalVoidScans.kt b/src/en/infernalvoidscans/src/eu/kanade/tachiyomi/extension/en/infernalvoidscans/InfernalVoidScans.kt deleted file mode 100644 index 674683ae2..000000000 --- a/src/en/infernalvoidscans/src/eu/kanade/tachiyomi/extension/en/infernalvoidscans/InfernalVoidScans.kt +++ /dev/null @@ -1,40 +0,0 @@ -package eu.kanade.tachiyomi.extension.en.infernalvoidscans - -import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia -import eu.kanade.tachiyomi.network.GET -import eu.kanade.tachiyomi.source.model.FilterList -import okhttp3.Request - -class InfernalVoidScans : MangaThemesia( - "Infernal Void Scans", - "https://hivetoon.com", - "en", -) { - override val client = super.client.newBuilder() - .addInterceptor { chain -> - val request = chain.request() - val headers = request.headers.newBuilder() - .set("Cache-Control", "max-age=0") - .build() - chain.proceed(request.newBuilder().headers(headers).build()) - } - .build() - - override fun headersBuilder() = super.headersBuilder() - .set("Cache-Control", "max-age=0") - - override val pageSelector = "div#readerarea > p > img" - - override val hasProjectPage = true - - override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = super.searchMangaRequest(page, query, filters).url.newBuilder() - .removeAllQueryParameters("title") - - // Filters are not loaded with the ā€˜sā€™ parameter. Fix genres filter - if (query.isNotBlank()) { - url.addQueryParameter("s", query) - } - return GET(url.build(), headers) - } -}