Nhentai | Fixed NPE in regex parser (#6389)
* Improve dataRegex * Bump versionCode * Use a more greedy regex * Remove debug logging * Remove unused import
This commit is contained in:
parent
21aedafb7d
commit
737a141bad
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'NHentai'
|
extName = 'NHentai'
|
||||||
extClass = '.NHFactory'
|
extClass = '.NHFactory'
|
||||||
extVersionCode = 49
|
extVersionCode = 50
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ open class NHentai(
|
||||||
}
|
}
|
||||||
|
|
||||||
private val shortenTitleRegex = Regex("""(\[[^]]*]|[({][^)}]*[)}])""")
|
private val shortenTitleRegex = Regex("""(\[[^]]*]|[({][^)}]*[)}])""")
|
||||||
private val dataRegex = Regex("""JSON.parse\("([^*]*)"\)""")
|
private val dataRegex = Regex("""JSON\.parse\(\s*"(.*)"\s*\)""")
|
||||||
private val hentaiSelector = "script:containsData(JSON.parse):not(:containsData(media_server))"
|
private val hentaiSelector = "script:containsData(JSON.parse):not(:containsData(media_server))"
|
||||||
private fun String.shortenTitle() = this.replace(shortenTitleRegex, "").trim()
|
private fun String.shortenTitle() = this.replace(shortenTitleRegex, "").trim()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue