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 Draff
parent 4c4a178b9e
commit 4cdce2bc1b
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
7 changed files with 42 additions and 6 deletions

View File

@ -2,8 +2,8 @@ ext {
extName = 'Magus Manga' extName = 'Magus Manga'
extClass = '.MagusManga' extClass = '.MagusManga'
themePkg = 'mangathemesia' themePkg = 'mangathemesia'
baseUrl = 'https://neroscans.com' baseUrl = 'https://dmvdepot.com'
overrideVersionCode = 4 overrideVersionCode = 5
} }
apply from: "$rootDir/common.gradle" 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 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 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.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class MagusManga : MangaThemesia( class MagusManga : MangaThemesiaAlt(
"Magus Manga", "Magus Manga",
"https://neroscans.com", "https://dmvdepot.com",
"en", "en",
mangaUrlDirectory = "/series", mangaUrlDirectory = "/series",
dateFormat = SimpleDateFormat("MMMMM dd, yyyy", Locale("en")), dateFormat = SimpleDateFormat("MMMMM dd, yyyy", Locale("en")),
) { ) {
override val id = 7792477462646075400 override val id = 7792477462646075400
override val client = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(::wafffCookieInterceptor)
.rateLimit(1, 1, TimeUnit.SECONDS) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .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>.*)['"]""")
} }