2021-03-02 15:37:40 +00:00
|
|
|
package eu.kanade.tachiyomi.extension.en.manhuaes
|
|
|
|
|
|
|
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
2021-09-14 15:06:22 +00:00
|
|
|
import eu.kanade.tachiyomi.network.GET
|
|
|
|
import eu.kanade.tachiyomi.source.model.SChapter
|
|
|
|
import eu.kanade.tachiyomi.util.asJsoup
|
|
|
|
import okhttp3.Response
|
2021-03-02 15:37:40 +00:00
|
|
|
|
2021-03-10 12:40:58 +00:00
|
|
|
class ManhuaES : Madara("Manhua ES", "https://manhuaes.com", "en") {
|
2021-09-14 15:06:22 +00:00
|
|
|
override fun chapterListParse(response: Response): List<SChapter> {
|
|
|
|
var chapterList = super.chapterListParse(response)
|
|
|
|
|
|
|
|
// the site adds a ghost chapter for some entries
|
|
|
|
chapterList.firstOrNull()?.let {
|
|
|
|
if (!isReleasedChapter(it)) {
|
|
|
|
chapterList = chapterList.subList(1, chapterList.size)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return chapterList
|
|
|
|
}
|
|
|
|
|
|
|
|
private fun isReleasedChapter(chapter: SChapter): Boolean {
|
|
|
|
val document = client.newCall(
|
|
|
|
GET(chapter.url, headersBuilder().build())
|
|
|
|
).execute().asJsoup()
|
|
|
|
|
|
|
|
return document.select(pageListParseSelector).isNotEmpty()
|
|
|
|
}
|
2021-03-02 15:37:40 +00:00
|
|
|
}
|