* Update domain for Shinigami * Update domain for WorldManhwas * Update domain for Ikifeng * Update domain for Siyahmelek * Update domain for Azora * Update domain for Aqua Manga * Set isNsfw explicitly * Update domain for Webtoon TR * fixup! Update domain for Shinigami * Update domain for Webtoon Hatti * Update domain for Elarc Reader -> Elarc Toon * amend! Update domain for Ikifeng Update domain for Ikifeng -> Lector Online * amend! Update domain for Siyahmelek Update domain for Siyahmeleki -> Gri Melek * fixup! Update domain for Siyahmelek
60 lines
2.1 KiB
Kotlin
60 lines
2.1 KiB
Kotlin
package eu.kanade.tachiyomi.extension.id.shinigami
|
|
|
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
|
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
|
import eu.kanade.tachiyomi.source.model.SChapter
|
|
import okhttp3.Headers
|
|
import okhttp3.OkHttpClient
|
|
import org.jsoup.nodes.Element
|
|
import java.util.concurrent.TimeUnit
|
|
import kotlin.random.Random
|
|
|
|
class Shinigami : Madara("Shinigami", "https://shinigami.moe", "id") {
|
|
// moved from Reaper Scans (id) to Shinigami (id)
|
|
override val id = 3411809758861089969
|
|
|
|
override val useNewChapterEndpoint = false
|
|
|
|
override fun searchPage(page: Int): String = if (page == 1) "" else "page/$page/"
|
|
|
|
override val client: OkHttpClient = super.client.newBuilder()
|
|
.rateLimit(4, 1, TimeUnit.SECONDS)
|
|
.build()
|
|
|
|
override fun headersBuilder(): Headers.Builder = super.headersBuilder()
|
|
.add("Sec-Fetch-Dest", "document")
|
|
.add("Sec-Fetch-Mode", "navigate")
|
|
.add("Sec-Fetch-Site", "same-origin")
|
|
.add("Upgrade-Insecure-Requests", "1")
|
|
.add("X-Requested-With", randomString)
|
|
|
|
private fun generateRandomString(length: Int): String {
|
|
val charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.abcdefghijklmnopqrstuvwxyz.0123456789"
|
|
return (1..length)
|
|
.map { charset.random() }
|
|
.joinToString("")
|
|
}
|
|
|
|
private val randomLength = Random.Default.nextInt(13, 21)
|
|
|
|
private val randomString = generateRandomString(randomLength)
|
|
|
|
override val mangaSubString = "semua-series"
|
|
|
|
// Tags are useless as they are just SEO keywords.
|
|
override val mangaDetailsSelectorTag = ""
|
|
|
|
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
|
val urlElement = element.selectFirst(chapterUrlSelector)!!
|
|
|
|
name = urlElement.selectFirst("p.chapter-manhwa-title")?.text()
|
|
?: urlElement.ownText()
|
|
date_upload = urlElement.selectFirst("span.chapter-release-date > i")?.text()
|
|
.let { parseChapterDate(it) }
|
|
|
|
val fixedUrl = urlElement.attr("abs:href")
|
|
|
|
setUrlWithoutDomain(fixedUrl)
|
|
}
|
|
}
|