From afad932bdd28f1b502f359b1bcb126363c805f2f Mon Sep 17 00:00:00 2001 From: DitFranXX <45893338+DitFranXX@users.noreply.github.com> Date: Mon, 1 Apr 2019 01:36:44 +0900 Subject: [PATCH] Revert name changes, Remove unnecessary interceptors, and Improve decoder on MSM (#990) Revert name changes and etcs... in MSM extension. --- src/ko/mangashowme/build.gradle | 4 +-- .../ko/mangashowme/MSMImageDecoder.kt | 4 ++- .../extension/ko/mangashowme/MangaShowMe.kt | 26 +------------------ 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/src/ko/mangashowme/build.gradle b/src/ko/mangashowme/build.gradle index 08507f1d5..bb18e8451 100644 --- a/src/ko/mangashowme/build.gradle +++ b/src/ko/mangashowme/build.gradle @@ -2,10 +2,10 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' ext { - appName = 'Tachiyomi: ManaMoa (MangaShow.Me)' + appName = 'Tachiyomi: MangaShow.Me (ManaMoa)' pkgNameSuffix = 'ko.mangashowme' extClass = '.MangaShowMe' - extVersionCode = 8 + extVersionCode = 9 libVersion = '1.2' } diff --git a/src/ko/mangashowme/src/eu/kanade/tachiyomi/extension/ko/mangashowme/MSMImageDecoder.kt b/src/ko/mangashowme/src/eu/kanade/tachiyomi/extension/ko/mangashowme/MSMImageDecoder.kt index 4cc10f6aa..c3ab6f755 100644 --- a/src/ko/mangashowme/src/eu/kanade/tachiyomi/extension/ko/mangashowme/MSMImageDecoder.kt +++ b/src/ko/mangashowme/src/eu/kanade/tachiyomi/extension/ko/mangashowme/MSMImageDecoder.kt @@ -52,7 +52,9 @@ internal class ImageDecoderInterceptor : Interceptor { val chapter = reqUrl.queryParameter("ch")!! 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 { decodeImageRequest(version, chapter, viewCnt, it) } diff --git a/src/ko/mangashowme/src/eu/kanade/tachiyomi/extension/ko/mangashowme/MangaShowMe.kt b/src/ko/mangashowme/src/eu/kanade/tachiyomi/extension/ko/mangashowme/MangaShowMe.kt index ac791a64d..357070083 100644 --- a/src/ko/mangashowme/src/eu/kanade/tachiyomi/extension/ko/mangashowme/MangaShowMe.kt +++ b/src/ko/mangashowme/src/eu/kanade/tachiyomi/extension/ko/mangashowme/MangaShowMe.kt @@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit * `manga_list` returns latest 'added' manga. not a chapter updates. **/ class MangaShowMe : ParsedHttpSource() { - override val name = "ManaMoa (MangaShow.Me)" + override val name = "MangaShow.Me" override val baseUrl = "https://manamoa.net" override val lang: String = "ko" @@ -33,30 +33,6 @@ class MangaShowMe : ParsedHttpSource() { .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) .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()!! //override fun popularMangaSelector() = "div.basic-post-gallery > div > div.post-row"