MangaFire: Fix volume entries (#3404)

Is like if someone deleted this on purpose
This commit is contained in:
bapeey 2024-06-05 07:19:31 -05:00 committed by Draff
parent d1e9584966
commit acaa33bc24
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 5 additions and 5 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.MangaFireFactory'
themePkg = 'mangareader'
baseUrl = 'https://mangafire.to'
overrideVersionCode = 4
overrideVersionCode = 5
isNsfw = true
}

View File

@ -138,13 +138,13 @@ open class MangaFire(
override fun parseChapterElements(response: Response, isVolume: Boolean): List<Element> {
val result = json.decodeFromString<ResponseDto<String>>(response.body.string()).result
val document = Jsoup.parse(result)
val elements = document.select("ul li")
val selector = if (isVolume) "div.unit" else "ul li"
val elements = document.select(selector)
if (elements.size > 0) {
val linkToFirstChapter = elements[0].selectFirst(Evaluator.Tag("a"))!!.attr("href")
val mangaId = linkToFirstChapter.toString().substringAfter('.').substringBefore('/')
val request = GET("$baseUrl/ajax/read/$mangaId/chapter/$langCode", headers)
val type = if (isVolume) volumeType else chapterType
val request = GET("$baseUrl/ajax/read/$mangaId/$type/$langCode", headers)
val response = client.newCall(request).execute()
val res = json.decodeFromString<ResponseDto<ChapterIdsDto>>(response.body.string()).result.html
val chapterInfoDocument = Jsoup.parse(res)