mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-25 11:42:47 +01:00
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
b908f79794
commit
147b7ed67d
@ -1,7 +1,7 @@
|
||||
ext {
|
||||
extName = 'Mangago'
|
||||
extClass = '.Mangago'
|
||||
extVersionCode = 17
|
||||
extVersionCode = 18
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -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 ->
|
||||
|
Loading…
Reference in New Issue
Block a user