|
|
|
|
@ -8,17 +8,17 @@ import okhttp3.Request
|
|
|
|
|
class ZeroMsProxyInterceptor : BaseImageProxyInterceptor() {
|
|
|
|
|
|
|
|
|
|
override suspend fun onInterceptImageRequest(request: ImageRequest, url: HttpUrl): ImageRequest {
|
|
|
|
|
if (url.host == "x.0ms.dev" || url.host == "0ms.dev") {
|
|
|
|
|
if (url.host == "v.recipes") {
|
|
|
|
|
return request
|
|
|
|
|
}
|
|
|
|
|
val newUrl = ("https://x.0ms.dev/q70/$url").toHttpUrl()
|
|
|
|
|
val newUrl = ("https://v.recipes/i/$url").toHttpUrl()
|
|
|
|
|
return request.newBuilder()
|
|
|
|
|
.data(newUrl)
|
|
|
|
|
.build()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override suspend fun onInterceptPageRequest(request: Request): Request {
|
|
|
|
|
val newUrl = ("https://x.0ms.dev/q70/${request.url}").toHttpUrl()
|
|
|
|
|
val newUrl = ("https://v.recipes/i/${request.url}").toHttpUrl()
|
|
|
|
|
return request.newBuilder()
|
|
|
|
|
.url(newUrl)
|
|
|
|
|
.build()
|
|
|
|
|
|