From 566c4c1832213d09243794dfb60fe38381daabd5 Mon Sep 17 00:00:00 2001 From: DitFranXX <45893338+DitFranXX@users.noreply.github.com> Date: Tue, 12 Mar 2019 22:46:48 +0900 Subject: [PATCH] Update extensions to fix issues (#891) Update extensions to fix issues --- src/fr/japscan/build.gradle | 2 +- .../tachiyomi/extension/fr/japscan/Japscan.kt | 19 ++++++++++++------- src/ko/jmana/build.gradle | 2 +- .../tachiyomi/extension/ko/jmana/JMana.kt | 2 +- src/ko/mangashowme/build.gradle | 6 +----- .../extension/ko/mangashowme/MangaShowMe.kt | 9 ++++++--- src/ko/newtoki/build.gradle | 2 +- .../tachiyomi/extension/ko/newtoki/NewToki.kt | 2 +- 8 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/fr/japscan/build.gradle b/src/fr/japscan/build.gradle index 4fd7b5945..4f6e3c7bb 100644 --- a/src/fr/japscan/build.gradle +++ b/src/fr/japscan/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Japscan' pkgNameSuffix = 'fr.japscan' extClass = '.Japscan' - extVersionCode = 7 + extVersionCode = 8 libVersion = '1.2' } diff --git a/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt b/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt index d3fb45cd3..e0bb7ed40 100644 --- a/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt +++ b/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt @@ -39,9 +39,13 @@ class Japscan : ParsedHttpSource() { override val supportsLatest = true override val client: OkHttpClient = network.cloudflareClient.newBuilder().addInterceptor { chain -> + val indicator = "&decodeImage" + val request = chain.request() - val response = chain.proceed(request) - if (!request.url().pathSegments().contains("clel")) return@addInterceptor response + val url = request.url().toString() + val response = chain.proceed(GET(url.substringBefore(indicator))) + + if (!url.endsWith(indicator)) return@addInterceptor response val res = response.body()!!.byteStream().use { decodeImage(it) @@ -60,13 +64,13 @@ class Japscan : ParsedHttpSource() { override fun popularMangaSelector() = "#top_mangas_week li > span" override fun popularMangaRequest(page: Int): Request { - return GET("$baseUrl", headers) + return GET(baseUrl, headers) } override fun latestUpdatesSelector() = "#chapters > div:eq(0) > h3.text-truncate" override fun latestUpdatesRequest(page: Int): Request { - return GET("$baseUrl", headers) + return GET(baseUrl, headers) } override fun popularMangaFromElement(element: Element): SManga { @@ -172,9 +176,10 @@ class Japscan : ParsedHttpSource() { override fun pageListParse(document: Document): List { val pages = mutableListOf() val imagePath = "(.*\\/).*".toRegex().find(document.select("#image").attr("data-src")) + val imageScrambled = if (!document.select("script[src^='/js/iYFbYi_']").isNullOrEmpty()) "&decodeImage" else "" document.select("select#pages").first()?.select("option")?.forEach { - pages.add(Page(pages.size, "", "${imagePath?.groupValues?.get(1)}${it.attr("data-img")}")) + pages.add(Page(pages.size, "", "${imagePath?.groupValues?.get(1)}${it.attr("data-img")}$imageScrambled")) } return pages @@ -197,7 +202,7 @@ class Japscan : ParsedHttpSource() { for (x in 0..input.width step 200) { val col1 = Rect(x, 0, x + 100, input.height) - if ((x + 200) <= input.width) { + if ((x + 200) < input.width) { val col2 = Rect(x + 100, 0, x + 200, input.height) xCanvas.drawBitmap(input, col1, col2, null) xCanvas.drawBitmap(input, col2, col1, null) @@ -211,7 +216,7 @@ class Japscan : ParsedHttpSource() { for (y in 0..input.height step 200) { val row1 = Rect(0, y, input.width, y + 100) - if ((y + 200) <= input.height) { + if ((y + 200) < input.height) { val row2 = Rect(0, y + 100, input.width, y + 200) canvas.drawBitmap(xResult, row1, row2, null) canvas.drawBitmap(xResult, row2, row1, null) diff --git a/src/ko/jmana/build.gradle b/src/ko/jmana/build.gradle index d2018877f..7df4ffe61 100644 --- a/src/ko/jmana/build.gradle +++ b/src/ko/jmana/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: JMana' pkgNameSuffix = 'ko.jmana' extClass = '.JMana' - extVersionCode = 4 + extVersionCode = 5 libVersion = '1.2' } diff --git a/src/ko/jmana/src/eu/kanade/tachiyomi/extension/ko/jmana/JMana.kt b/src/ko/jmana/src/eu/kanade/tachiyomi/extension/ko/jmana/JMana.kt index 3cf2d0778..4db84413f 100644 --- a/src/ko/jmana/src/eu/kanade/tachiyomi/extension/ko/jmana/JMana.kt +++ b/src/ko/jmana/src/eu/kanade/tachiyomi/extension/ko/jmana/JMana.kt @@ -16,7 +16,7 @@ import java.text.SimpleDateFormat **/ class JMana : ParsedHttpSource() { override val name = "JMana" - override val baseUrl = "https://mangahide.com" + override val baseUrl = "https://jmana5.com" override val lang: String = "ko" // Latest updates currently returns duplicate manga as it separates manga into chapters diff --git a/src/ko/mangashowme/build.gradle b/src/ko/mangashowme/build.gradle index 86109f7b3..a46717c88 100644 --- a/src/ko/mangashowme/build.gradle +++ b/src/ko/mangashowme/build.gradle @@ -5,12 +5,8 @@ ext { appName = 'Tachiyomi: MangaShow.Me' pkgNameSuffix = 'ko.mangashowme' extClass = '.MangaShowMe' - extVersionCode = 6 + extVersionCode = 7 libVersion = '1.2' } -dependencies { - compileOnly project(':duktape-stub') -} - apply from: "$rootDir/common.gradle" 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 221ffdbc5..d32ef18ca 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 @@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit **/ class MangaShowMe : ParsedHttpSource() { override val name = "MangaShow.Me" - override val baseUrl = "https://mangashow3.me" + override val baseUrl = "https://mangashow5.me" override val lang: String = "ko" // Latest updates currently returns duplicate manga as it separates manga into chapters @@ -212,8 +212,11 @@ class MangaShowMe : ParsedHttpSource() { (0 until imageUrls.length()) .map { imageUrls.getString(it) } .map { - it.replace(".mangashow.me", ".mangashow3.me") - .replace(".mangashow2.me", ".mangashow3.me") + val curr = ".mangashow5.me" + it + .replace(".mangashow.me", curr) + .replace(".mangashow2.me", curr) + .replace(".mangashow3.me", curr) } .forEach { pages.add(Page(pages.size, "", decoder.request(it))) } } catch (e: Exception) { diff --git a/src/ko/newtoki/build.gradle b/src/ko/newtoki/build.gradle index 04f9a13cd..3d75adf6c 100644 --- a/src/ko/newtoki/build.gradle +++ b/src/ko/newtoki/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: NewToki' pkgNameSuffix = 'ko.newtoki' extClass = '.NewToki' - extVersionCode = 4 + extVersionCode = 5 libVersion = '1.2' } diff --git a/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewToki.kt b/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewToki.kt index a2b5ac2b2..4c4137478 100644 --- a/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewToki.kt +++ b/src/ko/newtoki/src/eu/kanade/tachiyomi/extension/ko/newtoki/NewToki.kt @@ -18,7 +18,7 @@ import java.util.* **/ class NewToki : ParsedHttpSource() { override val name = "NewToki" - override val baseUrl = "https://newtoki2.net" + override val baseUrl = "https://newtoki3.net" override val lang: String = "ko" // Latest updates currently returns duplicate manga as it separates manga into chapters