Revert name changes, Remove unnecessary interceptors, and Improve decoder on MSM (#990)

Revert name changes and etcs... in MSM extension.
This commit is contained in:
DitFranXX 2019-04-01 01:36:44 +09:00 committed by Carlos
parent 9339cfcfe5
commit afad932bdd
3 changed files with 6 additions and 28 deletions

View File

@ -2,10 +2,10 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
ext { ext {
appName = 'Tachiyomi: ManaMoa (MangaShow.Me)' appName = 'Tachiyomi: MangaShow.Me (ManaMoa)'
pkgNameSuffix = 'ko.mangashowme' pkgNameSuffix = 'ko.mangashowme'
extClass = '.MangaShowMe' extClass = '.MangaShowMe'
extVersionCode = 8 extVersionCode = 9
libVersion = '1.2' libVersion = '1.2'
} }

View File

@ -52,7 +52,9 @@ internal class ImageDecoderInterceptor : Interceptor {
val chapter = reqUrl.queryParameter("ch")!! val chapter = reqUrl.queryParameter("ch")!!
val imageUrl = url.split("?").first() val imageUrl = url.split("?").first()
val response = chain.proceed(GET("$imageUrl?v=2")) val response = chain.proceed(GET("$imageUrl?quick"))
if (viewCnt.toInt() < 10) return response // Pass decoder if it's not scrambled.
val res = response.body()!!.byteStream().use { val res = response.body()!!.byteStream().use {
decodeImageRequest(version, chapter, viewCnt, it) decodeImageRequest(version, chapter, viewCnt, it)
} }

View File

@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit
* `manga_list` returns latest 'added' manga. not a chapter updates. * `manga_list` returns latest 'added' manga. not a chapter updates.
**/ **/
class MangaShowMe : ParsedHttpSource() { class MangaShowMe : ParsedHttpSource() {
override val name = "ManaMoa (MangaShow.Me)" override val name = "MangaShow.Me"
override val baseUrl = "https://manamoa.net" override val baseUrl = "https://manamoa.net"
override val lang: String = "ko" override val lang: String = "ko"
@ -33,30 +33,6 @@ class MangaShowMe : ParsedHttpSource() {
.connectTimeout(10, TimeUnit.SECONDS) .connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS)
.addInterceptor(ImageDecoderInterceptor()) .addInterceptor(ImageDecoderInterceptor())
.addInterceptor { chain ->
val req = chain.request()
var res: Response? = null
for (_i in 0..10) {
try {
res = chain.proceed(req)
} catch (e: javax.net.ssl.SSLHandshakeException) {
if (e.message.toString().contains("Connection reset by peer")) continue
}
break
}
res ?: chain.proceed(req)
}
.addInterceptor { chain ->
val response = chain.proceed(chain.request())
if (response.code() == 503) {
val body = response.body().toString()
if (body.contains("console.log(\"503\")") || body.contains("console.log('503')"))
throw Exception("Try again.\nServer returns 503 Service Unavailable.")
}
response
}
.build()!! .build()!!
//override fun popularMangaSelector() = "div.basic-post-gallery > div > div.post-row" //override fun popularMangaSelector() = "div.basic-post-gallery > div > div.post-row"