TMO and LectorManga: Fix ocasionally "no pages found" (#2)
This commit is contained in:
parent
b112237f05
commit
02a53b9ecf
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'LectorManga'
|
extName = 'LectorManga'
|
||||||
pkgNameSuffix = 'es.lectormanga'
|
pkgNameSuffix = 'es.lectormanga'
|
||||||
extClass = '.LectorManga'
|
extClass = '.LectorManga'
|
||||||
extVersionCode = 31
|
extVersionCode = 32
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
|
|||||||
it.text()
|
it.text()
|
||||||
}
|
}
|
||||||
description = document.select(".col-12.mt-2").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")
|
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 {
|
private fun redirectToReadPage(document: Document): Document {
|
||||||
val script1 = document.selectFirst("script:containsData(uniqid)")
|
val script1 = document.selectFirst("script:containsData(uniqid)")
|
||||||
val script2 = document.selectFirst("script:containsData(window.location.replace)")
|
val script2 = document.selectFirst("script:containsData(window.location.replace)")
|
||||||
|
val script3 = document.selectFirst("script:containsData(redirectUrl)")
|
||||||
|
|
||||||
val redirectHeaders = Headers.Builder()
|
val redirectHeaders = Headers.Builder()
|
||||||
.add("Referer", document.baseUri())
|
.add("Referer", document.baseUri())
|
||||||
@ -355,6 +356,14 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
|
|||||||
return redirectToReadPage(client.newCall(GET(url, redirectHeaders)).execute().asJsoup())
|
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
|
return document
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'TuMangaOnline'
|
extName = 'TuMangaOnline'
|
||||||
pkgNameSuffix = 'es.tumangaonline'
|
pkgNameSuffix = 'es.tumangaonline'
|
||||||
extClass = '.TuMangaOnline'
|
extClass = '.TuMangaOnline'
|
||||||
extVersionCode = 46
|
extVersionCode = 47
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
|
|||||||
it.text()
|
it.text()
|
||||||
}
|
}
|
||||||
description = document.select("p.element-description").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")
|
thumbnail_url = document.select(".book-thumbnail").attr("src")
|
||||||
}
|
}
|
||||||
private fun parseStatus(status: String) = when {
|
private fun parseStatus(status: String) = when {
|
||||||
@ -303,6 +303,7 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
|
|||||||
private fun redirectToReadPage(document: Document): Document {
|
private fun redirectToReadPage(document: Document): Document {
|
||||||
val script1 = document.selectFirst("script:containsData(uniqid)")
|
val script1 = document.selectFirst("script:containsData(uniqid)")
|
||||||
val script2 = document.selectFirst("script:containsData(window.location.replace)")
|
val script2 = document.selectFirst("script:containsData(window.location.replace)")
|
||||||
|
val script3 = document.selectFirst("script:containsData(redirectUrl)")
|
||||||
|
|
||||||
val redirectHeaders = Headers.Builder()
|
val redirectHeaders = Headers.Builder()
|
||||||
.add("Referer", document.baseUri())
|
.add("Referer", document.baseUri())
|
||||||
@ -331,6 +332,14 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
|
|||||||
return redirectToReadPage(client.newCall(GET(url, redirectHeaders)).execute().asJsoup())
|
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
|
return document
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user