Mangago regex edit (#5039)
* mangago custom regex * Update build.gradle * Update Mangago.kt * Update Mangago.kt * Update Mangago.kt * Update Mangago.kt * remove custom regex
This commit is contained in:
parent
3a811582b0
commit
8d408422a4
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Mangago'
|
extName = 'Mangago'
|
||||||
extClass = '.Mangago'
|
extClass = '.Mangago'
|
||||||
extVersionCode = 17
|
extVersionCode = 18
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,14 +170,18 @@ class Mangago : ParsedHttpSource(), ConfigurableSource {
|
||||||
|
|
||||||
override fun searchMangaNextPageSelector() = genreListingNextPageSelector
|
override fun searchMangaNextPageSelector() = genreListingNextPageSelector
|
||||||
|
|
||||||
private val titleRegex = Regex("""\(yaoi\)|\{Official\}|«Official»|〘Official〙|\(Official\)|\s\[Official]|\s「Official」|『Official』|\s?/Official\b""", RegexOption.IGNORE_CASE)
|
private var titleRegex: Regex =
|
||||||
private fun titleVersion(title: String) = title.replace(titleRegex, "").trim()
|
Regex(
|
||||||
|
"(?:\\([^()]*\\)|\\{[^{}]*\\}|\\[(?:(?!]).)*]|«[^»]*»|〘[^〙]*〙|「[^」]*」|『[^』]*』|≪[^≫]*≫|﹛[^﹜]*﹜|𖤍.+?𖤍|/.+?)\\s*|([|/~].*)",
|
||||||
|
RegexOption.IGNORE_CASE,
|
||||||
|
)
|
||||||
|
|
||||||
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
|
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
|
||||||
title = document.selectFirst(".w-title h1")!!.text()
|
title = document.selectFirst(".w-title h1")!!.text()
|
||||||
if (isRemoveTitleVersion()) {
|
if (isRemoveTitleVersion()) {
|
||||||
title = titleVersion(title)
|
title = title.replace(titleRegex, "").trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("information")!!.let {
|
document.getElementById("information")!!.let {
|
||||||
thumbnail_url = it.selectFirst("img")!!.attr("abs:src")
|
thumbnail_url = it.selectFirst("img")!!.attr("abs:src")
|
||||||
description = it.selectFirst(".manga_summary")?.let { summary ->
|
description = it.selectFirst(".manga_summary")?.let { summary ->
|
||||||
|
|
Loading…
Reference in New Issue