Xoxocomics: Fix pages (#4843)

* fix

* bump
This commit is contained in:
bapeey 2024-08-30 06:16:52 -05:00 committed by Draff
parent 57bbef431b
commit 4e3f2d235f
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 26 additions and 1 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.XoxoComics'
themePkg = 'wpcomics'
baseUrl = 'https://xoxocomic.com'
overrideVersionCode = 3
overrideVersionCode = 4
}
apply from: "$rootDir/common.gradle"

View File

@ -4,6 +4,7 @@ import eu.kanade.tachiyomi.multisrc.wpcomics.WPComics
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup
@ -22,6 +23,26 @@ class XoxoComics : WPComics(
dateFormat = SimpleDateFormat("MM/dd/yyyy", Locale.US),
gmtOffset = null,
) {
override val client = super.client.newBuilder()
.addNetworkInterceptor { chain ->
val request = chain.request()
if (!request.url.toString().endsWith("#imagereq")) {
return@addNetworkInterceptor chain.proceed(request)
}
val response = chain.proceed(request)
if (response.code == 404) { // 404 is returned even when the image is found
val newResponse = response.newBuilder()
.code(200)
.body(response.body)
.build()
newResponse
} else {
response
}
}
.build()
override val searchPath = "search-comic"
override val popularPath = "hot-comic"
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/comic-update?page=$page", headers)
@ -106,4 +127,8 @@ class XoxoComics : WPComics(
},
)
}
override fun imageRequest(page: Page): Request {
return GET(page.imageUrl!! + "#imagereq", headers)
}
}