Skip to content

Commit

Permalink
InfernalVoidScans: Switch to iken MultiSrc (#6642)
Browse files Browse the repository at this point in the history
* switch to iken

* public titleCache

* protected

* Change to Hive Scans
  • Loading branch information
Creepler13 authored Dec 19, 2024
1 parent 53da00c commit 2ff36b4
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>()

Expand Down
8 changes: 4 additions & 4 deletions src/en/infernalvoidscans/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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)
}
}

This file was deleted.

0 comments on commit 2ff36b4

Please sign in to comment.