diff --git a/vripper-core/src/main/kotlin/me/vripper/host/AcidimgHost.kt b/vripper-core/src/main/kotlin/me/vripper/host/AcidimgHost.kt index 9fa3e81..6028c00 100644 --- a/vripper-core/src/main/kotlin/me/vripper/host/AcidimgHost.kt +++ b/vripper-core/src/main/kotlin/me/vripper/host/AcidimgHost.kt @@ -44,8 +44,9 @@ internal class AcidimgHost( ) ) ) + it.setAbsoluteRequestUri(true) }.also { context.requests.add(it) } - log.debug(String.format("Requesting %s", httpPost.uri)) + log.info("Requesting {}", httpPost) val doc = try { httpService.client.execute( httpPost, context.httpContext diff --git a/vripper-core/src/main/kotlin/me/vripper/host/Host.kt b/vripper-core/src/main/kotlin/me/vripper/host/Host.kt index d884fda..8d0178d 100644 --- a/vripper-core/src/main/kotlin/me/vripper/host/Host.kt +++ b/vripper-core/src/main/kotlin/me/vripper/host/Host.kt @@ -157,8 +157,11 @@ internal abstract class Host( @Throws(HostException::class) fun head(url: String, context: ImageDownloadContext): Array
{ - val httpHead = HttpHead(url).also { context.requests.add(it) } - log.debug(String.format("Requesting %s", url)) + val httpHead = HttpHead(url).also { + it.setAbsoluteRequestUri(true) + context.requests.add(it) + } + log.info("Requesting {}", httpHead) return httpService.client.execute( httpHead, context.httpContext @@ -177,8 +180,11 @@ internal abstract class Host( transformer: (ClassicHttpResponse) -> T ): T { val httpGet = - HttpGet(url).also { it.addHeader("Referer", context.imageEntity.url) }.also { context.requests.add(it) } - log.debug(String.format("Requesting %s", url)) + HttpGet(url).also { + it.addHeader("Referer", context.imageEntity.url) + it.setAbsoluteRequestUri(true) + }.also { context.requests.add(it) } + log.info("Requesting {}", httpGet) return httpService.client.execute(httpGet, context.httpContext) { if (it.code / 100 != 2) { throw DownloadException("Server returned code ${it.code}") diff --git a/vripper-core/src/main/kotlin/me/vripper/host/ImxHost.kt b/vripper-core/src/main/kotlin/me/vripper/host/ImxHost.kt index 1c488d2..4f9904a 100644 --- a/vripper-core/src/main/kotlin/me/vripper/host/ImxHost.kt +++ b/vripper-core/src/main/kotlin/me/vripper/host/ImxHost.kt @@ -51,7 +51,12 @@ internal class ImxHost : Host("imx.to", 8) { val imgUrl = findPattern(image, subDomain) val result = runCatching { RequestLimit.getPermit(1) - val httpHead = HttpHead(imgUrl).also { context.requests.add(it) } + val httpHead = HttpHead(imgUrl) + .also { + it.setAbsoluteRequestUri(true) + context.requests.add(it) + } + log.info("Requesting: {}", httpHead) failFastHttpClient.execute(httpHead) { response -> if (response.code / 100 != 2) { throw HostException("Invalid response code ${response.code}") diff --git a/vripper-core/src/main/kotlin/me/vripper/services/VGAuthService.kt b/vripper-core/src/main/kotlin/me/vripper/services/VGAuthService.kt index 0b8d7f2..d9ea0b8 100644 --- a/vripper-core/src/main/kotlin/me/vripper/services/VGAuthService.kt +++ b/vripper-core/src/main/kotlin/me/vripper/services/VGAuthService.kt @@ -58,8 +58,9 @@ internal class VGAuthService( BasicNameValuePair("vb_login_md5password", password) ) ) + it.setAbsoluteRequestUri(true) } - log.info("Authenticating: ${postAuth.uri}") + log.info("Authenticating: {}", postAuth) try { val context = HttpClientContext.create().apply { cookieStore = diff --git a/vripper-core/src/main/kotlin/me/vripper/tasks/FetchMetadataTask.kt b/vripper-core/src/main/kotlin/me/vripper/tasks/FetchMetadataTask.kt index 327c3da..6ad2f92 100644 --- a/vripper-core/src/main/kotlin/me/vripper/tasks/FetchMetadataTask.kt +++ b/vripper-core/src/main/kotlin/me/vripper/tasks/FetchMetadataTask.kt @@ -41,10 +41,10 @@ internal class FetchMetadataTask( it.setParameter( "p", postId.toString() ) - }.build()) + }.build()).also { it.setAbsoluteRequestUri(true) } RequestLimit.getPermit(1) - log.debug("Requesting {}", httpGet.uri) + log.info("Requesting {}", httpGet) val response = httpService.client.execute(httpGet, vgAuthService.createVgContext()) { if (it.code / 100 != 2) { throw DownloadException("Unexpected response code '${it.code}' for $httpGet") diff --git a/vripper-core/src/main/kotlin/me/vripper/tasks/LeaveThanksTask.kt b/vripper-core/src/main/kotlin/me/vripper/tasks/LeaveThanksTask.kt index 8b23c5d..934d0ba 100644 --- a/vripper-core/src/main/kotlin/me/vripper/tasks/LeaveThanksTask.kt +++ b/vripper-core/src/main/kotlin/me/vripper/tasks/LeaveThanksTask.kt @@ -40,9 +40,10 @@ internal class LeaveThanksTask( BasicNameValuePair("securitytoken", postEntity.token) ) ) + it.setAbsoluteRequestUri(true) } RequestLimit.getPermit(1) - log.info("Posting {}", postThanks.uri) + log.info("Posting {}", postThanks) cm.client.execute(postThanks, context) { response -> if (response.code / 100 != 2) { throw VripperException("Unexpected response code '${response.code}' for $postThanks") diff --git a/vripper-core/src/main/kotlin/me/vripper/vgapi/PostLookupAPIParser.kt b/vripper-core/src/main/kotlin/me/vripper/vgapi/PostLookupAPIParser.kt index 4a88b45..f49a18f 100644 --- a/vripper-core/src/main/kotlin/me/vripper/vgapi/PostLookupAPIParser.kt +++ b/vripper-core/src/main/kotlin/me/vripper/vgapi/PostLookupAPIParser.kt @@ -32,7 +32,7 @@ internal class PostLookupAPIParser(private val threadId: Long, private val postI it.setParameter( "p", postId.toString() ) - }.build()) + }.build()).also { it.setAbsoluteRequestUri(true) } val threadLookupAPIResponseHandler = ThreadLookupAPIResponseHandler() Tasks.increment() return try { @@ -42,7 +42,7 @@ internal class PostLookupAPIParser(private val threadId: Long, private val postI ) }.get(CheckedSupplier { RequestLimit.getPermit(1) - log.info("Requesting {}", httpGet.uri) + log.info("Requesting {}", httpGet) httpService.client.execute( httpGet, vgAuthService.createClickContext() diff --git a/vripper-core/src/main/kotlin/me/vripper/vgapi/ThreadLookupAPIParser.kt b/vripper-core/src/main/kotlin/me/vripper/vgapi/ThreadLookupAPIParser.kt index 976caf6..f567b85 100644 --- a/vripper-core/src/main/kotlin/me/vripper/vgapi/ThreadLookupAPIParser.kt +++ b/vripper-core/src/main/kotlin/me/vripper/vgapi/ThreadLookupAPIParser.kt @@ -33,7 +33,7 @@ internal class ThreadLookupAPIParser(private val threadId: Long) : KoinComponent "t", threadId.toString() ) - }.build()) + }.build()).also { it.setAbsoluteRequestUri(true) } val threadLookupAPIResponseHandler = ThreadLookupAPIResponseHandler() Tasks.increment() return try { @@ -44,7 +44,7 @@ internal class ThreadLookupAPIParser(private val threadId: Long) : KoinComponent ) }.get(CheckedSupplier { RequestLimit.getPermit(1) - log.info("Requesting {}", httpGet.uri) + log.info("Requesting {}", httpGet) cm.client.execute( httpGet, vgAuthService.createClickContext() ) { response ->