mirror of
https://github.com/dev-claw/vripper-project.git
synced 2026-08-19 08:35:41 +02:00
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user