mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-25 19:52:56 +01:00
ArazNovel: fix chapterlist parse (#5509)
* fix selectors * default madara works * update baseurl
This commit is contained in:
parent
557e528298
commit
7fce782a92
@ -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"
|
||||
|
@ -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()),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user