ArazNovel: fix chapterlist parse (#5509)

* fix selectors

* default madara works

* update baseurl
This commit is contained in:
Lefan 2024-10-14 07:46:24 -04:00 committed by GitHub
parent 557e528298
commit 7fce782a92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 27 deletions

View File

@ -2,8 +2,8 @@ ext {
extName = 'ArazNovel'
extClass = '.ArazNovel'
themePkg = 'madara'
baseUrl = 'https://www.araznovel.com'
overrideVersionCode = 3
baseUrl = 'https://araznovel.com'
overrideVersionCode = 4
}
apply from: "$rootDir/common.gradle"

View File

@ -1,31 +1,12 @@
package eu.kanade.tachiyomi.extension.tr.araznovel
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Response
import java.text.SimpleDateFormat
import java.util.Locale
class ArazNovel : Madara("ArazNovel", "https://www.araznovel.com", "tr", SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())) {
override fun chapterListParse(response: Response): List<SChapter> {
val document = response.asJsoup()
val mangaId = document.select("div#manga-chapters-holder").attr("data-id")
val xhrRequest = oldXhrChaptersRequest(mangaId)
val xhrResponse = client.newCall(xhrRequest).execute()
return xhrResponse.asJsoup().let { xhrDocument ->
xhrDocument.select("li.parent").let { elements ->
if (!elements.isNullOrEmpty()) {
elements.reversed()
.map { volumeElement -> volumeElement.select(chapterListSelector()).map { chapterFromElement(it) } }
.flatten()
} else {
xhrDocument.select(chapterListSelector()).map { chapterFromElement(it) }
}
}
}
}
}
class ArazNovel : Madara(
"ArazNovel",
"https://araznovel.com",
"tr",
SimpleDateFormat("dd/MM/yyyy", Locale.getDefault()),
)