Commit c4368e54 authored by Florian Duguet's avatar Florian Duguet Committed by ntome

Add RecaptchaV3Job to captcha capability

and instanciate from RecaptchaV3Question in exception_to_job function
parent 101c93c2
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment