diff --git a/lib-multisrc/gigaviewer/build.gradle.kts b/lib-multisrc/gigaviewer/build.gradle.kts index b45873b5349..ede652be545 100644 --- a/lib-multisrc/gigaviewer/build.gradle.kts +++ b/lib-multisrc/gigaviewer/build.gradle.kts @@ -2,4 +2,4 @@ plugins { id("lib-multisrc") } -baseVersionCode = 5 +baseVersionCode = 6 diff --git a/lib-multisrc/gigaviewer/src/eu/kanade/tachiyomi/multisrc/gigaviewer/GigaViewer.kt b/lib-multisrc/gigaviewer/src/eu/kanade/tachiyomi/multisrc/gigaviewer/GigaViewer.kt index c34d90714f5..2ec54da0032 100644 --- a/lib-multisrc/gigaviewer/src/eu/kanade/tachiyomi/multisrc/gigaviewer/GigaViewer.kt +++ b/lib-multisrc/gigaviewer/src/eu/kanade/tachiyomi/multisrc/gigaviewer/GigaViewer.kt @@ -22,7 +22,6 @@ import kotlinx.serialization.json.jsonPrimitive import okhttp3.Call import okhttp3.Headers import okhttp3.HttpUrl.Companion.toHttpUrl -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull import okhttp3.Interceptor import okhttp3.MediaType.Companion.toMediaType import okhttp3.Request @@ -137,19 +136,22 @@ abstract class GigaViewer( override fun chapterListParse(response: Response): List { val document = response.asJsoup() - val readableProductList = document.selectFirst("div.js-readable-product-list")!! - val firstListEndpoint = readableProductList.attr("data-first-list-endpoint") - .toHttpUrl() - val latestListEndpoint = readableProductList.attr("data-latest-list-endpoint") - .toHttpUrlOrNull() ?: firstListEndpoint - val numberSince = latestListEndpoint.queryParameter("number_since")!!.toFloat() - .coerceAtLeast(firstListEndpoint.queryParameter("number_since")!!.toFloat()) + val aggregateId = document.selectFirst("script.js-valve")!!.attr("data-giga_series") val newHeaders = headers.newBuilder() .set("Referer", response.request.url.toString()) .build() - var readMoreEndpoint = firstListEndpoint.newBuilder() - .setQueryParameter("number_since", numberSince.toString()) + + var readMoreEndpoint = baseUrl.toHttpUrl().newBuilder() + .addPathSegment("api") + .addPathSegment("viewer") + .addPathSegment("readable_products") + .addQueryParameter("aggregate_id", aggregateId) + .addQueryParameter("number_since", Int.MAX_VALUE.toString()) + .addQueryParameter("number_until", "0") + .addQueryParameter("read_more_num", "150") + .addQueryParameter("type", "episode") + .build() .toString() val chapters = mutableListOf()