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:
Radon Rosborough 2025-06-14 01:49:10 -07:00 committed by Draff
parent 49ecc98bce
commit 8c6f4bfbcb
Signed by: Draff
GPG Key ID: E8A89F3211677653
2 changed files with 23 additions and 1 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Hiveworks Comics'
extClass = '.Hiveworks'
extVersionCode = 9
extVersionCode = 10
}
apply from: "$rootDir/common.gradle"

View File

@ -39,6 +39,28 @@ class Hiveworks : ParsedHttpSource() {
.readTimeout(1, TimeUnit.MINUTES)
.retryOnConnectionFailure(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()
// Popular