'How to pass proxies into anticaptcha?
so for the past few days i've been trying to pass proxiware proxies into anticaptcha (so the captcha gets solved using the same proxy as me), but no matter how many proxies i try, i get "ERROR_PROXY_CONNECT_REFUSED". i can't tell what's actually the problem here..
Code:
json={
"clientKey": captcha_key,
"task": {
"type": "HCaptchaTask",
"websiteURL": "Hidden",
"websiteKey": "Hidden",
"proxyType" : "http",
"proxyAddress": self.IP,
"proxyPort": self.Port,
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36"
}}
taskId = self._session.post("https://api.anti-captcha.com/createTask", json=json, timeout=30).result().json()
taskId = taskId.get("taskId")
solvedCaptcha = None
while not solvedCaptcha:
captchaData = self._session.post("https://api.anti-captcha.com/getTaskResult", json={"clientKey": captcha_key, "taskId": int(taskId)}, timeout=30).result().json()
print("[DATA] " , captchaData)
if captchaData.get("status") == "ready":
solvedCaptcha = captchaData.get("solution").get("gRecaptchaResponse")
Output:
[DATA] {'errorId': 0, 'status': 'processing'}
[DATA] {'errorId': 25, 'errorCode': 'ERROR_PROXY_CONNECT_REFUSED', 'errorDescription': 'Could not connect to proxy related to the task, connection refused'}
Also anticaptcha accepts only an IP, so i'm doing a request to https://api.ipify.org/ using the proxy to get the public ip, don't know if that's correct
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
