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:
kana-shii 2024-09-16 07:25:12 -03:00 committed by GitHub
parent b908f79794
commit 147b7ed67d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Mangago'
extClass = '.Mangago'
extVersionCode = 17
extVersionCode = 18
isNsfw = true
}

View File

@ -170,14 +170,18 @@ class Mangago : ParsedHttpSource(), ConfigurableSource {
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 fun titleVersion(title: String) = title.replace(titleRegex, "").trim()
private var titleRegex: Regex =
Regex(
"(?:\\([^()]*\\)|\\{[^{}]*\\}|\\[(?:(?!]).)*]|«[^»]*»|〘[^〙]*〙|「[^」]*」|『[^』]*』|≪[^≫]*≫|﹛[^﹜]*﹜|𖤍.+?𖤍|/.+?)\\s*|([|/~].*)",
RegexOption.IGNORE_CASE,
)
override fun mangaDetailsParse(document: Document) = SManga.create().apply {
title = document.selectFirst(".w-title h1")!!.text()
if (isRemoveTitleVersion()) {
title = titleVersion(title)
title = title.replace(titleRegex, "").trim()
}
document.getElementById("information")!!.let {
thumbnail_url = it.selectFirst("img")!!.attr("abs:src")
description = it.selectFirst(".manga_summary")?.let { summary ->