Skip to content

Commit 6a1bf72

Browse files
author
nextcaptcha
committed
add hs type,websitInfo param
1 parent 65ce69e commit 6a1bf72

File tree

3 files changed

+66
-43
lines changed

3 files changed

+66
-43
lines changed

README.md

-6
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@ To solve hCaptcha Enterprise challenges, use the hcaptcha_enterprise method:
6767
result = api.hcaptcha_enterprise(website_url="https://example.com", website_key="SITE_KEY")
6868
```
6969

70-
Solving FunCaptcha
71-
To solve FunCaptcha challenges, use the funcaptcha method:
72-
73-
```python
74-
result = api.funcaptcha(website_public_key="WEBSITE_PUBLIC_KEY")
75-
```
7670

7771
Checking Account Balance
7872
To check your NextCaptcha account balance, use the get_balance method:

nextcaptcha/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44

55

6-
__version__ = '1.0.9'
6+
__version__ = '1.1.0'

nextcaptcha/next.py

+65-36
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
RECAPTCHAV2_TYPE = "RecaptchaV2TaskProxyless"
1111
RECAPTCHAV2_ENTERPRISE_TYPE = "RecaptchaV2EnterpriseTaskProxyless"
12+
RECAPTCHAV2HS_ENTERPRISE_TYPE = "RecaptchaV2HSEnterpriseTaskProxyless"
1213
RECAPTCHAV3_PROXYLESS_TYPE = "RecaptchaV3TaskProxyless"
14+
RECAPTCHAV3HS_PROXYLESS_TYPE = "RecaptchaV3HSTaskProxyless"
1315
RECAPTCHAV3_TYPE = "RecaptchaV3Task"
1416
RECAPTCHA_MOBILE_PROXYLESS_TYPE = "ReCaptchaMobileTaskProxyLess"
1517
RECAPTCHA_MOBILE_TYPE = "ReCaptchaMobileTask"
1618
HCAPTCHA_TYPE = "HCaptchaTask"
1719
HCAPTCHA_PROXYLESS_TYPE = "HCaptchaTaskProxyless"
1820
HCAPTCHA_ENTERPRISE_TYPE = "HCaptchaEnterpriseTask"
19-
FUNCAPTCHA_TYPE = "FunCaptchaTask"
20-
FUNCAPTCHA_PROXYLESS_TYPE = "FunCaptchaTaskProxyless"
2121

2222
TIMEOUT = 45
2323

@@ -107,7 +107,8 @@ def __init__(self, client_key: str, solft_id: str = "", callback_url: str = "",
107107
self.api = ApiClient(client_key=client_key, solft_id=solft_id, callback_url=callback_url, open_log=open_log)
108108

109109
def recaptchav2(self, website_url: str, website_key: str, recaptcha_data_s_value: str = "",
110-
is_invisible: bool = False, api_domain: str = "", page_action: str = "") -> dict:
110+
is_invisible: bool = False, api_domain: str = "", page_action: str = "",
111+
website_info: str = "") -> dict:
111112
"""
112113
Solve reCAPTCHA v2 challenge.
113114
@@ -126,11 +127,13 @@ def recaptchav2(self, website_url: str, website_key: str, recaptcha_data_s_value
126127
"isInvisible": is_invisible,
127128
"apiDomain": api_domain,
128129
"pageAction": page_action,
130+
"websiteInfo": website_info
129131
}
130132
return self.api._send(task)
131133

132134
def recaptchav2enterprise(self, website_url: str, website_key: str, enterprise_payload: dict = {},
133-
is_invisible: bool = False, api_domain: str = "", page_action: str = "") -> dict:
135+
is_invisible: bool = False, api_domain: str = "", page_action: str = "",
136+
website_info: str = "") -> dict:
134137
"""
135138
Solve reCAPTCHA v2 Enterprise challenge.
136139
@@ -149,12 +152,40 @@ def recaptchav2enterprise(self, website_url: str, website_key: str, enterprise_p
149152
"isInvisible": is_invisible,
150153
"apiDomain": api_domain,
151154
"pageAction": page_action,
155+
"websiteInfo": website_info
156+
157+
}
158+
return self.api._send(task)
159+
160+
def recaptchav2hs_enterprise(self, website_url: str, website_key: str, enterprise_payload: dict = {},
161+
is_invisible: bool = False, api_domain: str = "", page_action: str = "",
162+
website_info: str = "") -> dict:
163+
"""
164+
Solve reCAPTCHA v2 Enterprise challenge.
165+
166+
:param website_url: The URL of the website where the reCAPTCHA is located.
167+
:param website_key: The sitekey of the reCAPTCHA.
168+
:param enterprise_payload: Optional. Additional enterprise payload parameters.
169+
:param is_invisible: Optional. Whether the reCAPTCHA is invisible or not.
170+
:param api_domain: Optional. The domain of the reCAPTCHA API if different from the default.
171+
:return: A dictionary containing the solution of the reCAPTCHA.
172+
"""
173+
task = {
174+
"type": RECAPTCHAV2HS_ENTERPRISE_TYPE,
175+
"websiteURL": website_url,
176+
"websiteKey": website_key,
177+
"enterprisePayload": enterprise_payload,
178+
"isInvisible": is_invisible,
179+
"apiDomain": api_domain,
180+
"pageAction": page_action,
181+
"websiteInfo": website_info
182+
152183
}
153184
return self.api._send(task)
154185

155186
def recaptchav3(self, website_url: str, website_key: str, page_action: str = "", api_domain: str = "",
156187
proxy_type: str = "", proxy_address: str = "", proxy_port: int = 0, proxy_login: str = "",
157-
proxy_password: str = "") -> dict:
188+
proxy_password: str = "", website_info: str = "") -> dict:
158189
"""
159190
Solve reCAPTCHA v3 challenge.
160191
@@ -175,6 +206,8 @@ def recaptchav3(self, website_url: str, website_key: str, page_action: str = "",
175206
"websiteKey": website_key,
176207
"pageAction": page_action,
177208
"apiDomain": api_domain,
209+
"websiteInfo": website_info
210+
178211
}
179212
if proxy_address:
180213
task["type"] = RECAPTCHAV3_TYPE
@@ -185,6 +218,33 @@ def recaptchav3(self, website_url: str, website_key: str, page_action: str = "",
185218
task["proxyPassword"] = proxy_password
186219
return self.api._send(task)
187220

221+
def recaptchav3hs(self, website_url: str, website_key: str, page_action: str = "", api_domain: str = "",
222+
website_info: str = "") -> dict:
223+
"""
224+
Solve reCAPTCHA v3 challenge.
225+
226+
:param website_url: The URL of the website where the reCAPTCHA is located.
227+
:param website_key: The sitekey of the reCAPTCHA.
228+
:param page_action: Optional. The action parameter to use for the reCAPTCHA.
229+
:param api_domain: Optional. The domain of the reCAPTCHA API if different from the default.
230+
:param proxy_type: Optional. The type of the proxy (HTTP, HTTPS, SOCKS4, SOCKS5).
231+
:param proxy_address: Optional. The address of the proxy.
232+
:param proxy_port: Optional. The port of the proxy.
233+
:param proxy_login: Optional. The login for the proxy.
234+
:param proxy_password: Optional. The password for the proxy.
235+
:return: A dictionary containing the solution of the reCAPTCHA.
236+
"""
237+
task = {
238+
"type": RECAPTCHAV3HS_PROXYLESS_TYPE,
239+
"websiteURL": website_url,
240+
"websiteKey": website_key,
241+
"pageAction": page_action,
242+
"apiDomain": api_domain,
243+
"websiteInfo": website_info
244+
245+
}
246+
return self.api._send(task)
247+
188248
def recaptcha_mobile(self, app_key: str, app_package_name: str = "", app_action: str = "", proxy_type: str = "",
189249
proxy_address: str = "", proxy_port: int = 0, proxy_login: str = "",
190250
proxy_password: str = "", app_device: str = "ios") -> dict:
@@ -276,37 +336,6 @@ def hcaptcha_enterprise(self, website_url: str, website_key: str, enterprise_pay
276336
}
277337
return self.api._send(task)
278338

279-
def funcaptcha(self, website_public_key: str, website_url: str = "", data: str = "", proxy_type: str = "",
280-
proxy_address: str = "", proxy_port: int = 0, proxy_login: str = "",
281-
proxy_password: str = "") -> dict:
282-
"""
283-
Solve FunCaptcha challenge.
284-
285-
:param website_public_key: The public key of the FunCaptcha.
286-
:param website_url: Optional. The URL of the website where the FunCaptcha is located.
287-
:param data: Optional. Additional data to be sent with the task.
288-
:param proxy_type: Optional. The type of the proxy (HTTP, HTTPS, SOCKS4, SOCKS5).
289-
:param proxy_address: Optional. The address of the proxy.
290-
:param proxy_port: Optional. The port of the proxy.
291-
:param proxy_login: Optional. The login for the proxy.
292-
:param proxy_password: Optional. The password for the proxy.
293-
:return: A dictionary containing the solution of the FunCaptcha.
294-
"""
295-
task = {
296-
"type": FUNCAPTCHA_PROXYLESS_TYPE,
297-
"websiteURL": website_url,
298-
"websitePublicKey": website_public_key,
299-
"data": data,
300-
}
301-
if proxy_address:
302-
task["type"] = FUNCAPTCHA_TYPE
303-
task["proxyType"] = proxy_type
304-
task["proxyAddress"] = proxy_address
305-
task["proxyPort"] = proxy_port
306-
task["proxyLogin"] = proxy_login
307-
task["proxyPassword"] = proxy_password
308-
return self.api._send(task)
309-
310339
def get_balance(self) -> str:
311340
"""
312341
Get the account balance.

0 commit comments

Comments
 (0)