This commit is contained in:
dev-claw
2026-04-30 21:40:06 +01:00
parent eec3d5d75c
commit 55dbc81a4c
3 changed files with 3 additions and 1 deletions
@@ -171,9 +171,9 @@ internal abstract class Host(
fun <T> fetch( fun <T> fetch(
url: String, url: String,
context: Context, context: Context,
referer: String = "https://vipergirls.to/",
transformer: (ClassicHttpResponse) -> T transformer: (ClassicHttpResponse) -> T
): T { ): T {
val referer = context.headers["Referer"] ?: "https://vipergirls.to/"
val httpGet = val httpGet =
HttpGet(url).also { HttpGet(url).also {
it.addHeader("Referer", referer) it.addHeader("Referer", referer)
@@ -35,6 +35,7 @@ internal class ViprImHost : Host("vipr.im", 15) {
.map { obj: Node -> obj.textContent } .map { obj: Node -> obj.textContent }
.map { obj: String -> obj.trim() }.orElse(null) .map { obj: String -> obj.trim() }.orElse(null)
val imgUrl = imgNode.attributes.getNamedItem("src").textContent.trim() val imgUrl = imgNode.attributes.getNamedItem("src").textContent.trim()
context.headers["Referer"] = "https://vipr.im/"
Pair(imgTitle!!, imgUrl) Pair(imgTitle!!, imgUrl)
} catch (e: Exception) { } catch (e: Exception) {
throw HostException("Unexpected error occurred", e) throw HostException("Unexpected error occurred", e)
@@ -49,6 +49,7 @@ internal class ImageDownloadRunnable(
cookieStore = HTTPService.cookieStore cookieStore = HTTPService.cookieStore
} }
val requests = mutableListOf<HttpUriRequestBase>() val requests = mutableListOf<HttpUriRequestBase>()
val headers = mutableMapOf<String, String>()
init { init {
ApplicationProperties.VRIPPER_DIR.listDirectoryEntries() ApplicationProperties.VRIPPER_DIR.listDirectoryEntries()