InfernalVoidScans: Switch to iken MultiSrc (#6642)
* switch to iken * public titleCache * protected * Change to Hive Scans
This commit is contained in:
parent
931711fe74
commit
4f5116c590
|
@ -33,7 +33,7 @@ abstract class Iken(
|
||||||
.set("Referer", "$baseUrl/")
|
.set("Referer", "$baseUrl/")
|
||||||
|
|
||||||
private var genres = emptyList<Pair<String, String>>()
|
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 response = client.newCall(GET("$baseUrl/api/query?perPage=9999", headers)).execute()
|
||||||
val data = response.parseAs<SearchResponse>()
|
val data = response.parseAs<SearchResponse>()
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Infernal Void Scans'
|
extName = 'Hive Scans'
|
||||||
extClass = '.InfernalVoidScans'
|
extClass = '.HiveScans'
|
||||||
themePkg = 'mangathemesia'
|
themePkg = 'iken'
|
||||||
baseUrl = 'https://hivetoon.com'
|
baseUrl = 'https://hivetoon.com'
|
||||||
overrideVersionCode = 10
|
overrideVersionCode = 36
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue