ManhwaHentaiMe: Fix Chapters Not Found (#4245)

* Fix Chapters

* LF
This commit is contained in:
KenjieDec 2024-07-26 15:15:51 +07:00 committed by GitHub
parent 03f361ce3b
commit 0c75945d37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 1 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.ManhwahentaiMe'
themePkg = 'madara'
baseUrl = 'https://manhwahentai.me'
overrideVersionCode = 3
overrideVersionCode = 4
isNsfw = true
}

View File

@ -1,10 +1,35 @@
package eu.kanade.tachiyomi.extension.en.manhwahentaime
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.FormBody
import okhttp3.Response
class ManhwahentaiMe : Madara("Manhwahentai.me", "https://manhwahentai.me", "en") {
override val useNewChapterEndpoint: Boolean = true
override val mangaSubString = "webtoon"
override fun chapterListParse(response: Response): List<SChapter> {
val document = response.asJsoup()
launchIO { countViews(document) }
val comicObj = document.selectFirst("script:containsData(comicObj)")!!.data()
val id = comicObj.filter { it.isDigit() }
val name = comicObj.substringBefore(":").substringAfter("{").trim()
val ajax_url = document.selectFirst("script:containsData(ajax)")!!.data().substringAfter('"').substringBefore('"')
val body = FormBody.Builder()
.add(name, id)
.add("action", "ajax_chap")
.build()
val doc = client.newCall(POST(ajax_url, headers, body)).execute().asJsoup()
val chapterElements = doc.select(chapterListSelector())
return chapterElements.map(::chapterFromElement)
}
}