@@ -105,6 +105,10 @@ class TwoCaptcha():
105105 Use this method to solve DataDome captcha.
106106 cybersiara(master_url_id, pageurl, userAgent, **kwargs)
107107 Use this method to solve CyberSiARA. Returns a token.
108+ yandex_smart(self, sitekey, url, **kwargs)
109+ Wrapper for solving Yandex Smart.
110+ altcha(self, pageurl, challenge_url=None, challenge_json=None, **kwargs)
111+ Wrapper for solving Altcha Captcha.
108112 solve(timeout=0, polling_interval=0, **kwargs)
109113 Sends CAPTCHA data and retrieves the result.
110114 balance()
@@ -1128,6 +1132,41 @@ def yandex_smart(self, sitekey, url, **kwargs):
11281132 ** kwargs )
11291133 return result
11301134
1135+ def altcha (self , pageurl , challenge_url = None , challenge_json = None , ** kwargs ):
1136+ '''Wrapper for solving Altcha Captcha.
1137+
1138+ Parameters
1139+ __________
1140+ pageurl : str
1141+ Full URL of the page where you solve the captcha.
1142+ challenge_url : str
1143+ The value of the 'challenge_url' parameter for the 'altcha-widget' element containing the captcha on the page.
1144+ You can send either challenge_url or challenge_json parameter, but not two of it simultaneously.
1145+ challenge_json : str
1146+ The contents of the file from the 'challenge_url' parameter. You can send either challenge_url or challenge_json
1147+ parameter, but not two of it simultaneously.
1148+ proxy : dict, optional
1149+ {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'}.
1150+
1151+ '''
1152+
1153+ if (challenge_url is None ) == (challenge_json is None ):
1154+ raise ValidationException (
1155+ 'You must provide exactly one of challenge_url or challenge_json'
1156+ )
1157+ params = {
1158+ 'pageurl' : pageurl ,
1159+ 'method' : "altcha" ,
1160+ ** kwargs ,
1161+ }
1162+ if challenge_url is not None :
1163+ params ['challenge_url' ] = challenge_url
1164+ if challenge_json is not None :
1165+ params ['challenge_json' ] = challenge_json
1166+
1167+ return self .solve (** params )
1168+
1169+
11311170 def solve (self , timeout = 0 , polling_interval = 0 , ** kwargs ):
11321171 '''Sends captcha, receives result.
11331172
0 commit comments