Magus Manga: Update domain & icons (#3491)

* MagusManga: Update domain

* MagusManga: Update icons

* MagusManga: Swap to `MangaThemesiaALt`

* MagusManga: Use LS `wafffCookieInterceptor` code for chapter page loading issue
This commit is contained in:
Smol Ame 2024-06-10 05:54:24 -07:00 committed by GitHub
parent ebd27e5fa8
commit 319f06f8a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 42 additions and 6 deletions

View File

@ -2,8 +2,8 @@ ext {
extName = 'Magus Manga'
extClass = '.MagusManga'
themePkg = 'mangathemesia'
baseUrl = 'https://neroscans.com'
overrideVersionCode = 4
baseUrl = 'https://dmvdepot.com'
overrideVersionCode = 5
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,21 +1,57 @@
package eu.kanade.tachiyomi.extension.en.magusmanga
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesiaAlt
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.Cookie
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.Response
import org.jsoup.Jsoup
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
class MagusManga : MangaThemesia(
class MagusManga : MangaThemesiaAlt(
"Magus Manga",
"https://neroscans.com",
"https://dmvdepot.com",
"en",
mangaUrlDirectory = "/series",
dateFormat = SimpleDateFormat("MMMMM dd, yyyy", Locale("en")),
) {
override val id = 7792477462646075400
override val client = super.client.newBuilder()
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(::wafffCookieInterceptor)
.rateLimit(1, 1, TimeUnit.SECONDS)
.build()
private fun wafffCookieInterceptor(chain: Interceptor.Chain): Response {
val request = chain.request()
val response = chain.proceed(request)
val document = Jsoup.parse(
response.peekBody(Long.MAX_VALUE).string(),
response.request.url.toString(),
)
return if (document.selectFirst("script:containsData(wafff)") != null) {
val script = document.selectFirst("script:containsData(wafff)")!!.data()
val cookie = waffRegex.find(script)?.groups?.get("waff")?.value
?.let { Cookie.parse(request.url, it) }
client.cookieJar.saveFromResponse(
request.url,
listOfNotNull(cookie),
)
response.close()
chain.proceed(request)
} else {
response
}
}
private val waffRegex = Regex("""document\.cookie\s*=\s*['"](?<waff>.*)['"]""")
}