SMBC: Handle 500 "error" on archive page (#9003)
* SMBC: Handle 500 "error" on archive page * Update based on code review * Update based on code review
This commit is contained in:
parent
49ecc98bce
commit
8c6f4bfbcb
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'Hiveworks Comics'
|
extName = 'Hiveworks Comics'
|
||||||
extClass = '.Hiveworks'
|
extClass = '.Hiveworks'
|
||||||
extVersionCode = 9
|
extVersionCode = 10
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
@ -39,6 +39,28 @@ class Hiveworks : ParsedHttpSource() {
|
|||||||
.readTimeout(1, TimeUnit.MINUTES)
|
.readTimeout(1, TimeUnit.MINUTES)
|
||||||
.retryOnConnectionFailure(true)
|
.retryOnConnectionFailure(true)
|
||||||
.followRedirects(true)
|
.followRedirects(true)
|
||||||
|
.addNetworkInterceptor { chain ->
|
||||||
|
val request = chain.request()
|
||||||
|
if (!request.url.toString().contains("smbc-comics")) {
|
||||||
|
return@addNetworkInterceptor chain.proceed(request)
|
||||||
|
}
|
||||||
|
|
||||||
|
val response = chain.proceed(request)
|
||||||
|
// As of March 2025, SMBC chapter list page returns status code 500 even
|
||||||
|
// though it still has correct data. Do not throw an error in this case.
|
||||||
|
//
|
||||||
|
// I reported this error to SMBC on 2025-05-28 and it was not fixed by
|
||||||
|
// 2025-06-11, but even if it is fixed eventually, the same problem might
|
||||||
|
// occur again in the future.
|
||||||
|
if (response.code == 500) {
|
||||||
|
val newResponse = response.newBuilder()
|
||||||
|
.code(200)
|
||||||
|
.build()
|
||||||
|
newResponse
|
||||||
|
} else {
|
||||||
|
response
|
||||||
|
}
|
||||||
|
}
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
// Popular
|
// Popular
|
||||||
|
Loading…
x
Reference in New Issue
Block a user