Add Komikindo (#3956)

This commit is contained in:
Vetle Ledaal 2024-07-12 13:06:30 +02:00 committed by GitHub
parent 26f9705b2d
commit bb1a0ee103
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,10 @@
ext {
extName = 'Komikindo'
extClass = '.Komikindo'
themePkg = 'mangathemesia'
baseUrl = 'https://komikindo.sbs'
overrideVersionCode = 0
isNsfw = true
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,43 @@
package eu.kanade.tachiyomi.extension.id.komikindo
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SManga
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import org.jsoup.nodes.Document
class Komikindo : MangaThemesia(
"Komikindo",
"https://komikindo.sbs",
"id",
) {
// Some covers fail to load with no Accept header + no resize parameter.
// Hence the workarounds:
private val cdnHeaders = imageRequest(Page(0, "$baseUrl/", baseUrl)).headers
override val client = super.client.newBuilder()
.addInterceptor { chain ->
val request = chain.request()
val url = request.url.toString()
if (url.contains("/wp-content/uploads/")) {
return@addInterceptor chain.proceed(request.newBuilder().headers(cdnHeaders).build())
}
chain.proceed(request)
}
.build()
override fun mangaDetailsParse(document: Document): SManga {
return super.mangaDetailsParse(document).apply {
thumbnail_url = thumbnail_url
?.toHttpUrlOrNull()
?.takeIf { it.queryParameter("resize") == null }
?.newBuilder()
?.setEncodedQueryParameter("resize", "165,225")
?.build()
?.toString()
}
}
override val hasProjectPage = true
}