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'
|
extName = 'SamuraiScan'
|
||||||
extClass = '.SamuraiScan'
|
extClass = '.SamuraiScan'
|
||||||
themePkg = 'madara'
|
themePkg = 'madara'
|
||||||
baseUrl = 'https://samuraiscan.cookni.net'
|
baseUrl = 'https://samurai.wordoco.com'
|
||||||
overrideVersionCode = 12
|
overrideVersionCode = 13
|
||||||
isNsfw = false
|
isNsfw = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,26 +2,70 @@ package eu.kanade.tachiyomi.extension.es.manhuaonline
|
|||||||
|
|
||||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||||
|
import okhttp3.Interceptor
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.Response
|
||||||
|
import java.net.SocketTimeoutException
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
class SamuraiScan : Madara(
|
class SamuraiScan : Madara(
|
||||||
"SamuraiScan",
|
"SamuraiScan",
|
||||||
"https://samuraiscan.cookni.net",
|
"https://samurai.wordoco.com",
|
||||||
"es",
|
"es",
|
||||||
SimpleDateFormat("dd MMMM, yyyy", Locale("es")),
|
SimpleDateFormat("dd MMMM, yyyy", Locale("es")),
|
||||||
) {
|
) {
|
||||||
override val id = 5713083996691468192
|
override val id = 5713083996691468192
|
||||||
|
|
||||||
override val useLoadMoreRequest = LoadMoreStrategy.Never
|
override val useLoadMoreRequest = LoadMoreStrategy.Never
|
||||||
|
|
||||||
override val useNewChapterEndpoint = true
|
override val useNewChapterEndpoint = true
|
||||||
|
|
||||||
override val mangaSubString = "rd"
|
override val mangaSubString = "rd"
|
||||||
|
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
|
.followRedirects(false)
|
||||||
|
.addInterceptor(::fixFollowRedirects)
|
||||||
.rateLimit(3)
|
.rateLimit(3)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val mangaDetailsSelectorDescription = "div.summary_content div.manga-summary"
|
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'
|
extName = 'Rüya Manga'
|
||||||
extClass = '.RuyaManga'
|
extClass = '.RuyaManga'
|
||||||
themePkg = 'madara'
|
themePkg = 'madara'
|
||||||
baseUrl = 'https://www.ruya-manga.com'
|
baseUrl = 'https://www.ruyamanga2.com'
|
||||||
overrideVersionCode = 3
|
overrideVersionCode = 4
|
||||||
isNsfw = false
|
isNsfw = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import java.util.Locale
|
|||||||
|
|
||||||
class RuyaManga : Madara(
|
class RuyaManga : Madara(
|
||||||
"Rüya Manga",
|
"Rüya Manga",
|
||||||
"https://www.ruya-manga.com",
|
"https://www.ruyamanga2.com",
|
||||||
"tr",
|
"tr",
|
||||||
SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH),
|
SimpleDateFormat("dd/MM/yyyy", Locale.ENGLISH),
|
||||||
) {
|
) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = "Dua Leo Truyen"
|
extName = "Dua Leo Truyen"
|
||||||
extClass = ".DuaLeoTruyen"
|
extClass = ".DuaLeoTruyen"
|
||||||
extVersionCode = 7
|
extVersionCode = 8
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class DuaLeoTruyen : ParsedHttpSource() {
|
|||||||
|
|
||||||
override val name = "Dưa Leo Truyện"
|
override val name = "Dưa Leo Truyện"
|
||||||
|
|
||||||
override val baseUrl = "https://dualeotruyenbeta.com"
|
override val baseUrl = "https://dualeotruyenbotz.com"
|
||||||
|
|
||||||
override val lang = "vi"
|
override val lang = "vi"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user