From c46b309657b4b1ab0b1ed0be57e053e63cc34b0e Mon Sep 17 00:00:00 2001 From: Virus Noir <67117684+VirusNoirrr@users.noreply.github.com> Date: Tue, 7 May 2024 17:46:16 +0100 Subject: [PATCH] Update __init__.py --- ProCap/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ProCap/__init__.py b/ProCap/__init__.py index 3f973ad..c7f7fe0 100644 --- a/ProCap/__init__.py +++ b/ProCap/__init__.py @@ -3,11 +3,12 @@ class Task: def __init__(self, response: dict) -> None: self.id = response.get("taskId") + self.captchaType = response.get("captchaType") self.time = response.get("time") self.success = response.get("success") self.error = response.get("error") self.status = response.get("status") - self.token = response.get("solution").get("generated_pass_uuid") + self.token = response.get("solution").get("generated_pass_uuid") if self.captchaType == "hCaptchaTask" else response.get("solution") self.challengeKey = response.get("solution").get("challenge_key") self.response = response @@ -24,14 +25,14 @@ class ProCap: def __init__(self, apikey) -> None: self.apikey = apikey def get_balance(self): - request = requests.get("https://api.procap.wtf/user") + request = requests.get("http://api.procap.wtf/user") return User(request.json()) def createTask(self, url=None, sitekey=None, proxy=None, userAgent=None, rqdata=None, isEnterprise=False, type="hCaptchaTask"): payload = { "clientKey": self.apikey, "task": { "type": type, - "href":url, + "href" if type == "hCaptchaTask" else "pjs": url, "sitekey": sitekey, "proxy": proxy, "useragent": userAgent, @@ -40,11 +41,12 @@ def createTask(self, url=None, sitekey=None, proxy=None, userAgent=None, rqdata= } if "hcaptcha" in type and isEnterprise: payload.update({"isEnterprise": isEnterprise}) - request = requests.post("https://api.procap.wtf/createTask", json=payload).json() + request = requests.post("http://api.procap.wtf/createTask", json=payload) + request = request.json() request["solution"] = {} return Task(request) def checkTask(self, id): - request = requests.get("https://api.procap.wtf/checkTask", json={ + request = requests.get("http://api.procap.wtf/checkTask", json={ "clientKey": self.apikey, "taskId": id })