IkigaiMangas: Fix http 404 when reading a chapter (#2511)
* fix pages * remove dto
This commit is contained in:
parent
ecb0606bb4
commit
d3a34b5693
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Ikigai Mangas'
|
extName = 'Ikigai Mangas'
|
||||||
extClass = '.IkigaiMangas'
|
extClass = '.IkigaiMangas'
|
||||||
extVersionCode = 5
|
extVersionCode = 6
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.source.model.SChapter
|
import eu.kanade.tachiyomi.source.model.SChapter
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import eu.kanade.tachiyomi.source.online.HttpSource
|
import eu.kanade.tachiyomi.source.online.HttpSource
|
||||||
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
import kotlinx.serialization.decodeFromString
|
import kotlinx.serialization.decodeFromString
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||||
|
@ -141,14 +142,13 @@ class IkigaiMangas : HttpSource() {
|
||||||
return mangas
|
return mangas
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun pageListRequest(chapter: SChapter): Request {
|
override fun pageListRequest(chapter: SChapter): Request =
|
||||||
val id = chapter.url.substringAfter("/capitulo/")
|
GET(baseUrl + chapter.url.substringBefore("#"), headers)
|
||||||
return GET("$apiBaseUrl/api/swf/chapters/$id", headers)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun pageListParse(response: Response): List<Page> {
|
override fun pageListParse(response: Response): List<Page> {
|
||||||
return json.decodeFromString<PayloadPagesDto>(response.body.string()).chapter.pages.mapIndexed { i, img ->
|
val document = response.asJsoup()
|
||||||
Page(i, "", img)
|
return document.select("section > div.img > img").mapIndexed { i, element ->
|
||||||
|
Page(i, imageUrl = element.attr("abs:src"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,16 +109,6 @@ class ChapterMetaDto(
|
||||||
fun hasNextPage() = currentPage < lastPage
|
fun hasNextPage() = currentPage < lastPage
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
|
||||||
class PayloadPagesDto(
|
|
||||||
val chapter: PageDto,
|
|
||||||
)
|
|
||||||
|
|
||||||
@Serializable
|
|
||||||
class PageDto(
|
|
||||||
val pages: List<String>,
|
|
||||||
)
|
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
class SeriesStatusDto(
|
class SeriesStatusDto(
|
||||||
val id: Long,
|
val id: Long,
|
||||||
|
|
Loading…
Reference in New Issue