Add a new source to Madara. (#12265)
This commit is contained in:
parent
c57c31b295
commit
c847abe03d
|
@ -0,0 +1,39 @@
|
|||
package eu.kanade.tachiyomi.extension.pt.leituranoturna
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Response
|
||||
import okhttp3.internal.closeQuietly
|
||||
import java.io.IOException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class LeituraNoturna : Madara(
|
||||
"Leitura Noturna",
|
||||
"https://leituranoturna.com",
|
||||
"pt-BR",
|
||||
SimpleDateFormat("dd 'de' MMMMM 'de' yyyy", Locale("pt", "BR"))
|
||||
) {
|
||||
|
||||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||
.addInterceptor(::loginCheckIntercept)
|
||||
.build()
|
||||
|
||||
// Page has custom link to scan website.
|
||||
override val popularMangaUrlSelector = "div.post-title a:not([target])"
|
||||
|
||||
private fun loginCheckIntercept(chain: Interceptor.Chain): Response {
|
||||
val response = chain.proceed(chain.request())
|
||||
|
||||
if (response.request.url.toString().contains("wp-login")) {
|
||||
response.closeQuietly()
|
||||
throw IOException("Faça login pela WebView para utilizar a extensão.")
|
||||
}
|
||||
|
||||
return response
|
||||
}
|
||||
}
|
|
@ -166,6 +166,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
|||
SingleLang("LHTranslation", "https://lhtranslation.net", "en", overrideVersionCode = 1),
|
||||
SingleLang("Lara Manga", "https://laramanga.com", "en"),
|
||||
SingleLang("Latest Manga", "https://latestmanga.net", "en", overrideVersionCode = 1),
|
||||
SingleLang("Leitura Noturna", "https://leituranoturna.com", "pt-BR", isNsfw = true),
|
||||
SingleLang("Levelerscans", "https://levelerscans.xyz", "en", overrideVersionCode = 1),
|
||||
SingleLang("Leviatan Scans X", "https://xxx.leviatanscans.com", "en", isNsfw = true),
|
||||
SingleLang("Lily Manga", "https://lilymanga.com", "en"),
|
||||
|
|
Loading…
Reference in New Issue