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 GitHub
parent 3feb355beb
commit d6953b899e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 8 deletions

View File

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

View File

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