diff --git a/weboob/capabilities/captcha.py b/weboob/capabilities/captcha.py index 79faa08f33d9ecc0fd19c5df0afb7cc3ae6a1713..5a505e76398673b2e9fb56f5448a16c82b6ebece 100644 --- a/weboob/capabilities/captcha.py +++ b/weboob/capabilities/captcha.py @@ -20,7 +20,9 @@ from time import sleep from .base import Capability, BaseObject, StringField, UserError, BytesField -from ..exceptions import RecaptchaQuestion, NocaptchaQuestion, FuncaptchaQuestion, ImageCaptchaQuestion +from ..exceptions import ( + RecaptchaQuestion, RecaptchaV3Question, NocaptchaQuestion, FuncaptchaQuestion, ImageCaptchaQuestion +) __all__ = [ @@ -42,6 +44,12 @@ class RecaptchaJob(SolverJob): solution_challenge = StringField('Challenge ID of the solution (output value)') +class RecaptchaV3Job(SolverJob): + site_url = StringField('Site URL for ReCaptcha service') + site_key = StringField('Site key for ReCaptcha service') + action = StringField('Website owner defines what user is doing on the page through this parameter.') + + class NocaptchaJob(SolverJob): site_url = StringField('Site URL for NoCaptcha service') site_key = StringField('Site key for NoCaptcha service') @@ -78,6 +86,11 @@ def exception_to_job(exc): job = RecaptchaJob() job.site_url = exc.website_url job.site_key = exc.website_key + elif isinstance(exc, RecaptchaV3Question): + job = RecaptchaV3Job() + job.site_url = exc.website_url + job.site_key = exc.website_key + job.action = exc.action elif isinstance(exc, NocaptchaQuestion): job = NocaptchaJob() job.site_url = exc.website_url