35 lines
1.1 KiB
Kotlin
35 lines
1.1 KiB
Kotlin
package eu.kanade.tachiyomi.extension.pt.neoxscanlator
|
|
|
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
|
import eu.kanade.tachiyomi.source.model.FilterList
|
|
import okhttp3.Headers
|
|
import okhttp3.OkHttpClient
|
|
import java.text.SimpleDateFormat
|
|
import java.util.Locale
|
|
import java.util.concurrent.TimeUnit
|
|
|
|
class NeoxScanlator : Madara(
|
|
"Neox Scanlator",
|
|
"https://neoxscans.net",
|
|
"pt-BR",
|
|
SimpleDateFormat("dd/MM/yyyy", Locale("pt", "BR"))
|
|
) {
|
|
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
|
.connectTimeout(1, TimeUnit.MINUTES)
|
|
.readTimeout(1, TimeUnit.MINUTES)
|
|
.build()
|
|
|
|
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
|
.add("User-Agent", USER_AGENT)
|
|
.add("Referer", baseUrl)
|
|
.add("Origin", baseUrl)
|
|
|
|
// Only status and order by filter work.
|
|
override fun getFilterList(): FilterList = FilterList(super.getFilterList().slice(3..4))
|
|
|
|
companion object {
|
|
private const val USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " +
|
|
"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"
|
|
}
|
|
}
|