diff --git a/src/es/lectormanga/build.gradle b/src/es/lectormanga/build.gradle index 2bb4e184..0707aa86 100644 --- a/src/es/lectormanga/build.gradle +++ b/src/es/lectormanga/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'LectorManga' pkgNameSuffix = 'es.lectormanga' extClass = '.LectorManga' - extVersionCode = 31 + extVersionCode = 32 isNsfw = true } diff --git a/src/es/lectormanga/src/eu/kanade/tachiyomi/extension/es/lectormanga/LectorManga.kt b/src/es/lectormanga/src/eu/kanade/tachiyomi/extension/es/lectormanga/LectorManga.kt index 6593f1d3..f308a342 100644 --- a/src/es/lectormanga/src/eu/kanade/tachiyomi/extension/es/lectormanga/LectorManga.kt +++ b/src/es/lectormanga/src/eu/kanade/tachiyomi/extension/es/lectormanga/LectorManga.kt @@ -228,7 +228,7 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() { it.text() } description = document.select(".col-12.mt-2").text() - status = parseStatus(document.select(".status-publishing").text().orEmpty()) + status = parseStatus(document.select(".status-publishing").text()) thumbnail_url = document.select(".text-center img.img-fluid").attr("src") } @@ -327,6 +327,7 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() { private fun redirectToReadPage(document: Document): Document { val script1 = document.selectFirst("script:containsData(uniqid)") val script2 = document.selectFirst("script:containsData(window.location.replace)") + val script3 = document.selectFirst("script:containsData(redirectUrl)") val redirectHeaders = Headers.Builder() .add("Referer", document.baseUri()) @@ -355,6 +356,14 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() { return redirectToReadPage(client.newCall(GET(url, redirectHeaders)).execute().asJsoup()) } + if (script3 != null) { + val data = script3.data() + val regexRedirect = """redirectUrl\s?=\s?'(.+)'""".toRegex() + val url = regexRedirect.find(data)!!.groupValues[1] + + return redirectToReadPage(client.newCall(GET(url, redirectHeaders)).execute().asJsoup()) + } + return document } diff --git a/src/es/tumangaonline/build.gradle b/src/es/tumangaonline/build.gradle index 8fa6d0c5..29ea5d1d 100644 --- a/src/es/tumangaonline/build.gradle +++ b/src/es/tumangaonline/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'TuMangaOnline' pkgNameSuffix = 'es.tumangaonline' extClass = '.TuMangaOnline' - extVersionCode = 46 + extVersionCode = 47 isNsfw = true } diff --git a/src/es/tumangaonline/src/eu/kanade/tachiyomi/extension/es/tumangaonline/TuMangaOnline.kt b/src/es/tumangaonline/src/eu/kanade/tachiyomi/extension/es/tumangaonline/TuMangaOnline.kt index 7468ad90..27ca28ec 100644 --- a/src/es/tumangaonline/src/eu/kanade/tachiyomi/extension/es/tumangaonline/TuMangaOnline.kt +++ b/src/es/tumangaonline/src/eu/kanade/tachiyomi/extension/es/tumangaonline/TuMangaOnline.kt @@ -216,7 +216,7 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() { it.text() } description = document.select("p.element-description").text() - status = parseStatus(document.select("span.book-status").text().orEmpty()) + status = parseStatus(document.select("span.book-status").text()) thumbnail_url = document.select(".book-thumbnail").attr("src") } private fun parseStatus(status: String) = when { @@ -303,6 +303,7 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() { private fun redirectToReadPage(document: Document): Document { val script1 = document.selectFirst("script:containsData(uniqid)") val script2 = document.selectFirst("script:containsData(window.location.replace)") + val script3 = document.selectFirst("script:containsData(redirectUrl)") val redirectHeaders = Headers.Builder() .add("Referer", document.baseUri()) @@ -331,6 +332,14 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() { return redirectToReadPage(client.newCall(GET(url, redirectHeaders)).execute().asJsoup()) } + if (script3 != null) { + val data = script3.data() + val regexRedirect = """redirectUrl\s?=\s?'(.+)'""".toRegex() + val url = regexRedirect.find(data)!!.groupValues[1] + + return redirectToReadPage(client.newCall(GET(url, redirectHeaders)).execute().asJsoup()) + } + return document }