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") {
|
2022-03-15 11:43:49 +00:00
|
|
|
|
2022-04-06 11:33:17 +00:00
|
|
|
// The website does not flag the content.
|
|
|
|
override val useLoadMoreSearch = false
|
|
|
|
override val filterNonMangaItems = false
|
2022-03-15 11:43:49 +00:00
|
|
|
|
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(
|
2023-02-11 19:21:03 +00:00
|
|
|
GET(chapter.url, headersBuilder().build()),
|
2021-09-14 15:06:22 +00:00
|
|
|
).execute().asJsoup()
|
|
|
|
|
|
|
|
return document.select(pageListParseSelector).isNotEmpty()
|
|
|
|
}
|
2021-03-02 15:37:40 +00:00
|
|
|
}
|