From 159235dfa59d653f0424d65432a69f0fd0966f2b Mon Sep 17 00:00:00 2001 From: CK Date: Mon, 3 Jun 2024 23:44:41 +0200 Subject: [PATCH] added funcaptcha --- captchakiller/ck.py | 30 ++++++++++++++++++++++++++---- examples/funcaptcha.py | 23 +++++++++++++++++++++++ examples/recaptchav2.py | 13 +++++++++++++ examples/recaptchav2enterprise.py | 14 ++++++++++++++ examples/recaptchav3lowscore.py | 7 +++++++ 5 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 examples/funcaptcha.py diff --git a/captchakiller/ck.py b/captchakiller/ck.py index 1001a1f..7c4f8fe 100644 --- a/captchakiller/ck.py +++ b/captchakiller/ck.py @@ -15,7 +15,7 @@ def getbalance(self): return response else: response.update({"success": False}) - return {"errorId": "0", "error": "Unknown error"} + return {"errorId":0, "error": "Unknown error"} class CaptchaKiller: @@ -54,7 +54,7 @@ def recaptcha_v2(self, sitekey, site, gdomain=False, invisible=False, payload=No return response else: response.update({"success": False}) - return {"errorId": "0", "error": "Unknown error"} + return {"errorId":0, "error": "Unknown error"} def recaptcha_v2_enterprise(self, sitekey, site, gdomain=False, invisible=False, payload=None, action=None): url = self.SOLVE_ENDPOINT + 'solvev2e' @@ -78,7 +78,7 @@ def recaptcha_v2_enterprise(self, sitekey, site, gdomain=False, invisible=False, return response else: response.update({"success": False}) - return {"errorId": "0", "error": "Unknown error"} + return {"errorId":0, "error": "Unknown error"} def recaptcha_v3_low_score(self, sitekey, site, action, gdomain=False): url = self.SOLVE_ENDPOINT + 'solvev3ls' @@ -100,4 +100,26 @@ def recaptcha_v3_low_score(self, sitekey, site, action, gdomain=False): return response else: response.update({"success": False}) - return {"errorId": "0", "error": "Unknown error"} \ No newline at end of file + return {"errorId":0, "error": "Unknown error"} + def funcaptcha(self, publickey, site, surl=None, datatype=None, data=None): + url = self.SOLVE_ENDPOINT + 'solveark' + + queryparams = { + 'publickey': publickey, + 'site': site, + 'surl': surl, + 'datatype': datatype, + 'data': data, + } + + response = _send_request(self, url, queryparams, {}) + + if 'error' in response: + response.update({"success": False}) + return response + elif 'result' in response: + response.update({"success": True}) + return response + else: + response.update({"success": False}) + return {"errorId":0, "error": "Unknown error"} \ No newline at end of file diff --git a/examples/funcaptcha.py b/examples/funcaptcha.py new file mode 100644 index 0000000..285453b --- /dev/null +++ b/examples/funcaptcha.py @@ -0,0 +1,23 @@ +from captchakiller import CaptchaKiller + +captcha_killer = CaptchaKiller() + +""" + Use custom configuration + captcha_killer = CaptchaKiller("API_KEY") +""" + +""" + REQUIRED - publickey: DF9C4D87-CB7B-4062-9FEB-BADB6ADA61E6 // Public key of the FunCaptcha challeng + REQUIRED - site: https://demo.arkoselabs.com // URL of the website where the FunCaptcha challenge is located + OPTIONAL - surl: https://client-api.arkoselabs.com // URL of the Arkose Labs API server + OPTIONAL - datatype: blob // Data type of the data sent in the challenge + OPTIONAL - data: ENsYWf9hLu6E5oSTcPby1t8iK4TCZgv... // Data sent in the challenge +""" + +response = captcha_killer.funcaptcha("DF9C4D87-CB7B-4062-9FEB-BADB6ADA61E6", "https://demo.arkoselabs.com") + +if response['success']: + print("Captcha solved: " + response["result"]) +else: + print("Error: " + str(response["errorId"]) + " - " + response["error"]) \ No newline at end of file diff --git a/examples/recaptchav2.py b/examples/recaptchav2.py index de81f7c..b2410eb 100644 --- a/examples/recaptchav2.py +++ b/examples/recaptchav2.py @@ -7,6 +7,19 @@ captcha_killer = CaptchaKiller("API_KEY") """ +""" + REQUIRED - sitekey: 6LfW6wATAAAAAHLqO2pb8bDBahxlMxNdo9g947u9 // Recaptcha v2 challenge site key + REQUIRED - site: https://recaptcha-demo.appspot.com/ // Recaptcha v2 challenge page URL + OPTIONAL - gdomain: false // If the domain is a Recaptcha, false is google by default + OPTIONAL - invisible: false // If the Recaptcha is invisible, false by default + OPTIONAL - payload: 3Zky78k550-A2.... // The s parameter in the anchor request + OPTIONAL - proxytype: HTTP // Your proxy type (HTTP, SOCKS4, SOCKS5) + OPTIONAL - proxyaddress: 127.0.0.1 // Your proxy address + OPTIONAL - proxyport: 8080 // Your proxy port + OPTIONAL - proxyuser: user // Your proxy login (if required) + OPTIONAL - proxypass: pass // Your proxy password (if required) +""" + response = captcha_killer.recaptcha_v2("6LfW6wATAAAAAHLqO2pb8bDBahxlMxNdo9g947u9", "https://recaptcha-demo.appspot.com/") if response['success']: diff --git a/examples/recaptchav2enterprise.py b/examples/recaptchav2enterprise.py index 0884706..2f133af 100644 --- a/examples/recaptchav2enterprise.py +++ b/examples/recaptchav2enterprise.py @@ -7,6 +7,20 @@ captcha_killer = CaptchaKiller("API_KEY") """ +""" + REQUIRED - sitekey: 6LfW6wATAAAAAHLqO2pb8bDBahxlMxNdo9g947u9 // Recaptcha v2 challenge site key + REQUIRED - site: https://recaptcha-demo.appspot.com/ // Recaptcha v2 challenge page URL + OPTIONAL - gdomain: false // If the domain is a Recaptcha, false is google by default + OPTIONAL - invisible: false // If the Recaptcha is invisible, false by default + OPTIONAL - payload: 3Zky78k550-A2.... // The s parameter in the anchor request + OPTIONAL - action: Default // The sa parameter in the anchor request + OPTIONAL - proxytype: HTTP // Your proxy type (HTTP, SOCKS4, SOCKS5) + OPTIONAL - proxyaddress: 127.0.0.1 // Your proxy address + OPTIONAL - proxyport: 8080 // Your proxy port + OPTIONAL - proxyuser: user // Your proxy login (if required) + OPTIONAL - proxypass: pass // Your proxy password (if required) +""" + response = captcha_killer.recaptcha_v2_enterprise("6LfW6wATAAAAAHLqO2pb8bDBahxlMxNdo9g947u9", "https://recaptcha-demo.appspot.com/") if response['success']: diff --git a/examples/recaptchav3lowscore.py b/examples/recaptchav3lowscore.py index 88c9ce2..07316fe 100644 --- a/examples/recaptchav3lowscore.py +++ b/examples/recaptchav3lowscore.py @@ -7,6 +7,13 @@ captcha_killer = CaptchaKiller("API_KEY") """ +""" + REQUIRED - sitekey: 6LdKlZEpAAAAAAOQjzC2v_d36tWxCl6dWsozdSy9 // Recaptcha v3 challenge site key + REQUIRED - site: https://recaptcha-demo.appspot.com/ // Recaptcha v3 challenge page URL + REQUIRED - action: examples/v3scores // Recaptcha v3 site action, if not known, try "homepage", "submit", "verify", "register", or "login" + OPTIONAL - gdomain: false // If the domain is a Recaptcha, false is google by default +""" + response = captcha_killer.recaptcha_v3_low_score("6LdKlZEpAAAAAAOQjzC2v_d36tWxCl6dWsozdSy9", "https://recaptcha-demo.appspot.com/", "examples/v3scores") if response['success']: