@@ -998,40 +998,29 @@ async def yandex_smart(self, sitekey, url, **kwargs):
998998 ** kwargs )
999999 return result
10001000
1001- async def altcha (self , pageurl , challenge_url = None , challenge_json = None , ** kwargs ):
1001+ async def altcha (self , pageurl , ** kwargs ):
10021002 '''Wrapper for solving Altcha Captcha.
10031003
10041004 Parameters
10051005 __________
10061006 pageurl : str
10071007 Full URL of the page where you solve the captcha.
1008- challenge_url : str
1008+ challenge_url : str, optional
10091009 The value of the 'challenge_url' parameter for the 'altcha-widget' element containing the captcha on the page.
1010- You can send either challenge_url or challenge_json parameter, but not two of it simultaneously .
1011- challenge_json : str
1012- The contents of the file from the 'challenge_url' parameter. You can send either challenge_url or challenge_json
1013- parameter, but not two of it simultaneously .
1010+ At least one of the parameters 'challenge_url', 'challenge_json' must be passed .
1011+ challenge_json : str, optional
1012+ The contents of the file from the 'challenge_url' parameter.
1013+ At least one of the parameters 'challenge_url', 'challenge_json' must be passed .
10141014 proxy : dict, optional
10151015 {'type': 'HTTPS', 'uri': 'login:password@IP_address:PORT'}.
10161016
10171017 '''
10181018
1019- if (challenge_url is None ) == (challenge_json is None ):
1020- raise ValidationException (
1021- 'You must provide exactly one of challenge_url or challenge_json'
1022- )
1023-
1024- params = {
1025- 'pageurl' : pageurl ,
1026- 'method' : 'altcha' ,
1027- ** kwargs ,}
1028-
1029- if challenge_url is not None :
1030- params ['challenge_url' ] = challenge_url
1031- if challenge_json is not None :
1032- params ['challenge_json' ] = challenge_json
1019+ result = self .solve (pageurl = pageurl ,
1020+ method = 'altcha' ,
1021+ ** kwargs )
10331022
1034- return await self . solve ( ** params )
1023+ return await result
10351024
10361025 async def solve (self , timeout = 0 , polling_interval = 0 , ** kwargs ):
10371026 '''Sends captcha, receives result.
0 commit comments