Fix mangakatana chapters only having 1 page (#13109)

Mangakatana updated their javascript and the chapter images are now in the htnc variable.
Fixes #13062
This commit is contained in:
dec05eba 2022-08-20 17:25:15 +02:00 committed by GitHub
parent 1ad891e202
commit 13880ccdf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaKatana'
pkgNameSuffix = 'en.mangakatana'
extClass = '.MangaKatana'
extVersionCode = 6
extVersionCode = 7
}
apply from: "$rootDir/common.gradle"

View File

@ -179,7 +179,7 @@ class MangaKatana : ConfigurableSource, ParsedHttpSource() {
date_upload = dateFormat.parse(element.select(".update_time").text())?.time ?: 0
}
private val imageArrayRegex = Regex("""var ytaw=\[([^\[]*)]""")
private val imageArrayRegex = Regex("""var htnc=\[([^\[]*)]""")
private val imageUrlRegex = Regex("""'([^']*)'""")
// Page List
@ -190,7 +190,7 @@ class MangaKatana : ConfigurableSource, ParsedHttpSource() {
}
override fun pageListParse(document: Document): List<Page> {
val imageArray = document.select("script:containsData(var ytaw)").firstOrNull()?.data()
val imageArray = document.select("script:containsData(var htnc)").firstOrNull()?.data()
?.let { imageArrayRegex.find(it)?.groupValues?.get(1) }
?: throw Exception("Image array not found")
return imageUrlRegex.findAll(imageArray).asIterable().mapIndexed { i, mr ->