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