This commit is contained in:
dev-claw
2025-09-19 18:41:04 +01:00
committed by GitHub
parent aa0119f881
commit 6df84c0756
6 changed files with 8 additions and 7 deletions
@@ -46,7 +46,7 @@ internal class AcidimgHost(
)
it.setAbsoluteRequestUri(true)
}.also { context.requests.add(it) }
log.info("Requesting {}", httpPost)
log.info("{}", httpPost)
val doc = try {
httpService.client.execute(
httpPost, context.httpContext
@@ -161,7 +161,7 @@ internal abstract class Host(
it.setAbsoluteRequestUri(true)
context.requests.add(it)
}
log.info("Requesting {}", httpHead)
log.info("{}", httpHead)
return httpService.client.execute(
httpHead,
context.httpContext
@@ -184,7 +184,7 @@ internal abstract class Host(
it.addHeader("Referer", context.imageEntity.url)
it.setAbsoluteRequestUri(true)
}.also { context.requests.add(it) }
log.info("Requesting {}", httpGet)
log.info("{}", httpGet)
return httpService.client.execute(httpGet, context.httpContext) {
if (it.code / 100 != 2) {
throw DownloadException("Server returned code ${it.code}")
@@ -56,7 +56,7 @@ internal class ImxHost : Host("imx.to", 8) {
it.setAbsoluteRequestUri(true)
context.requests.add(it)
}
log.info("Requesting: {}", httpHead)
log.info("{}", httpHead)
failFastHttpClient.execute(httpHead) { response ->
if (response.code / 100 != 2) {
throw HostException("Invalid response code ${response.code}")
@@ -79,6 +79,7 @@ internal class ImxHost : Host("imx.to", 8) {
.replace("http:", "https:")
.replace("imx.to", subDomain)
.replace("upload/small/", "i/")
.replace("u/i/", "i/")
.replace("u/t/", "i/")
.replace("t/", "i/")
}
@@ -44,7 +44,7 @@ internal class FetchMetadataTask(
}.build()).also { it.setAbsoluteRequestUri(true) }
RequestLimit.getPermit(1)
log.info("Requesting {}", httpGet)
log.info("{}", httpGet)
val response = httpService.client.execute(httpGet, vgAuthService.createVgContext()) {
if (it.code / 100 != 2) {
throw DownloadException("Unexpected response code '${it.code}' for $httpGet")
@@ -42,7 +42,7 @@ internal class PostLookupAPIParser(private val threadId: Long, private val postI
)
}.get(CheckedSupplier {
RequestLimit.getPermit(1)
log.info("Requesting {}", httpGet)
log.info("{}", httpGet)
httpService.client.execute(
httpGet,
vgAuthService.createClickContext()
@@ -44,7 +44,7 @@ internal class ThreadLookupAPIParser(private val threadId: Long) : KoinComponent
)
}.get(CheckedSupplier {
RequestLimit.getPermit(1)
log.info("Requesting {}", httpGet)
log.info("{}", httpGet)
cm.client.execute(
httpGet, vgAuthService.createClickContext()
) { response ->