Update domains (#8108)
* Update SamuraiScan domain * Update RuyaManga domain * Update DuaLeonTruyen domain * Bump version * Add interceptor in SamuraiScan
This commit is contained in:
parent
2c52f117d4
commit
99c8f52676
@ -2,8 +2,8 @@ ext {
|
||||
extName = 'SamuraiScan'
|
||||
extClass = '.SamuraiScan'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://samuraiscan.cookni.net'
|
||||
overrideVersionCode = 12
|
||||
baseUrl = 'https://samurai.wordoco.com'
|
||||
overrideVersionCode = 13
|
||||
isNsfw = false
|
||||
}
|
||||
|
||||
|
@ -2,26 +2,70 @@ package eu.kanade.tachiyomi.extension.es.manhuaonline
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Response
|
||||
import java.net.SocketTimeoutException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class SamuraiScan : Madara(
|
||||
"SamuraiScan",
|
||||
"https://samuraiscan.cookni.net",
|
||||
"https://samurai.wordoco.com",
|
||||
"es",
|
||||
SimpleDateFormat("dd MMMM, yyyy", Locale("es")),
|
||||
) {
|
||||
override val id = 5713083996691468192
|
||||
|
||||
override val useLoadMoreRequest = LoadMoreStrategy.Never
|
||||
|
||||
override val useNewChapterEndpoint = true
|
||||
|
||||
override val mangaSubString = "rd"
|
||||
|
||||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
.followRedirects(false)
|
||||
.addInterceptor(::fixFollowRedirects)
|
||||
.rateLimit(3)
|
||||
.build()
|
||||
|
||||
override val mangaDetailsSelectorDescription = "div.summary_content div.manga-summary"
|
||||
|
||||
// ========================== Utilities =========================
|
||||
|
||||
private fun fixFollowRedirects(chain: Interceptor.Chain): Response {
|
||||
val response = chain.proceed(chain.request())
|
||||
val location = response.takeIf { it.isRedirect }?.headers?.get("location")
|
||||
?: return response
|
||||
|
||||
response.close()
|
||||
|
||||
val sslLocation = location
|
||||
.replace(SSL_REGEX, "https")
|
||||
.replace(WWW_REGEX, "")
|
||||
|
||||
mutableListOf(sslLocation, location).forEach { url ->
|
||||
val newRequest = response.request.newBuilder()
|
||||
.url(url)
|
||||
.build()
|
||||
|
||||
val redirectResponse = try {
|
||||
chain.proceed(newRequest)
|
||||
} catch (e: SocketTimeoutException) {
|
||||
return@forEach
|
||||
}
|
||||
|
||||
if (redirectResponse.isSuccessful.not()) {
|
||||
redirectResponse.close()
|
||||
return@forEach
|
||||
}
|
||||
return redirectResponse
|
||||
}
|
||||
return chain.proceed(chain.request())
|
||||
}
|
||||
|
||||
companion object {
|
||||
val SSL_REGEX = """https?""".toRegex()
|
||||
val WWW_REGEX = """[wW]{3}\.""".toRegex()
|
||||
}
|
||||
}
|
||||
|
@ -2,8 +2,8 @@ ext {
|
||||
extName = 'Rüya Manga'
|
||||
extClass = '.RuyaManga'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://www.ruya-manga.com'
|
||||
overrideVersionCode = 3
|
||||
baseUrl = 'https://www.ruyamanga2.com'
|
||||
overrideVersionCode = 4
|
||||
isNsfw = false
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import java.util.Locale
|
||||
|
||||
class RuyaManga : Madara(
|
||||
"Rüya Manga",
|
||||
"https://www.ruya-manga.com",
|
||||
"https://www.ruyamanga2.com",
|
||||
"tr",
|
||||
SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH),
|
||||
) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = "Dua Leo Truyen"
|
||||
extClass = ".DuaLeoTruyen"
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ class DuaLeoTruyen : ParsedHttpSource() {
|
||||
|
||||
override val name = "Dưa Leo Truyện"
|
||||
|
||||
override val baseUrl = "https://dualeotruyenbeta.com"
|
||||
override val baseUrl = "https://dualeotruyenbotz.com"
|
||||
|
||||
override val lang = "vi"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user