InfernalVoidScans: Switch to iken MultiSrc (#6642)

* switch to iken

* public titleCache

* protected

* Change to Hive Scans
This commit is contained in:
Creepler13 2024-12-19 12:39:55 +01:00 committed by Draff
parent 931711fe74
commit 4f5116c590
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
4 changed files with 43 additions and 45 deletions

View File

@ -33,7 +33,7 @@ abstract class Iken(
.set("Referer", "$baseUrl/")
private var genres = emptyList<Pair<String, String>>()
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<SearchResponse>()

View File

@ -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"

View File

@ -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)
}
}

View File

@ -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)
}
}