IkigaiMangas: Fix webview (#2183)

* Fix webview

* wtf, why i made this
This commit is contained in:
bapeey 2024-03-31 01:26:31 -05:00 committed by Draff
parent 480cb9d780
commit 08b7ec34bd
2 changed files with 12 additions and 8 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Ikigai Mangas' extName = 'Ikigai Mangas'
extClass = '.IkigaiMangas' extClass = '.IkigaiMangas'
extVersionCode = 3 extVersionCode = 4
isNsfw = true isNsfw = true
} }

View File

@ -102,18 +102,22 @@ class IkigaiMangas : HttpSource() {
return MangasPage(mangaList, result.hasNextPage()) return MangasPage(mangaList, result.hasNextPage())
} }
override fun mangaDetailsParse(response: Response): SManga { override fun getMangaUrl(manga: SManga) = baseUrl + manga.url.substringBefore("#")
val slug = response.request.url
.toString() override fun mangaDetailsRequest(manga: SManga): Request {
val slug = manga.url
.substringAfter("/series/comic-") .substringAfter("/series/comic-")
.substringBefore("#") .substringBefore("#")
val apiUrl = "$apiBaseUrl/api/swf/series/$slug".toHttpUrl()
val newResponse = client.newCall(GET(url = apiUrl, headers = headers)).execute() return GET("$apiBaseUrl/api/swf/series/$slug", headers)
val result = json.decodeFromString<PayloadSeriesDetailsDto>(newResponse.body.string()) }
override fun mangaDetailsParse(response: Response): SManga {
val result = json.decodeFromString<PayloadSeriesDetailsDto>(response.body.string())
return result.series.toSMangaDetails() return result.series.toSMangaDetails()
} }
override fun getChapterUrl(chapter: SChapter) = baseUrl + chapter.url override fun getChapterUrl(chapter: SChapter) = baseUrl + chapter.url.substringBefore("#")
override fun chapterListRequest(manga: SManga): Request { override fun chapterListRequest(manga: SManga): Request {
val slug = manga.url.substringAfter("/series/comic-").substringBefore("#") val slug = manga.url.substringAfter("/series/comic-").substringBefore("#")