woob.capabilities.captcha¶
- class CapCaptchaSolver[source]¶
Bases:
CapabilityProvide CAPTCHA solving
- RETRIES = 30¶
- WAIT_TIME = 2¶
- create_job(job)[source]¶
Start a CAPTCHA solving job
The job.id shall be filled. The CAPTCHA is not solved yet when the method returns.
- Parameters:
job (
SolverJob) – job to start- Raises:
NotImplementedErrorif CAPTCHA type is not supported- Raises:
CaptchaErrorin case of other error
- poll_job(job)[source]¶
Check if a job was solved
If job is solved, return True and fill job.solution. Return False if solution is still pending. In case of solving problem, an exception may be raised.
It should not wait for the solution but return the current state.
- Parameters:
job (
SolverJob) – job to check and to fill when solved- Returns:
True if the job was solved
- Return type:
- Raises:
- solve_captcha_blocking(job)[source]¶
Start a CAPTCHA solving job and wait for its solution
- Parameters:
job (
SolverJob) – job to start and solve- Raises:
- class SolverJob(id='', url=NotLoaded, backend=None)[source]¶
Bases:
BaseObject
- class RecaptchaV3Job(id='', url=NotLoaded, backend=None)[source]¶
Bases:
SolverJob- Variables:
url – (
str) urlsolution – (
str) CAPTCHA solutionsite_url – (
str) Site URL for ReCaptcha servicesite_key – (
str) Site key for ReCaptcha serviceaction – (
str) Website owner defines what user is doing on the page through this parameter.min_score – (
float) Minimum score the reCaptcha response is required to have to be valid.is_enterprise – (
bool) If it is a reCaptcha enterprise
- exception TurnstileQuestion(website_key, website_url)[source]¶
Bases:
CaptchaQuestionA Cloudflare Turnstile captcha has been encountered and requires resolution.
- type = 'TurnstileTaskProxyless'¶
- website_key = None¶
- website_url = None¶
- exception UnsolvableCaptcha[source]¶
Bases:
CaptchaErrorCAPTCHA is too hard or impossible
- exception InvalidCaptcha[source]¶
Bases:
CaptchaErrorCAPTCHA cannot be used (e.g. invalid image format)
- exception InsufficientFunds[source]¶
Bases:
CaptchaErrorNot enough funds to pay solution
- exception ImageCaptchaQuestion(image_data)[source]¶
Bases:
CaptchaQuestionThe site signals to us that an image captcha should be solved.
- type = 'image_captcha'¶
- image_data = None¶
- exception RecaptchaV2Question(website_key, website_url)[source]¶
Bases:
CaptchaQuestionThe site signals to us that a recaptchav2 challenge should be solved.
- type = 'g_recaptcha'¶
- website_key = None¶
- website_url = None¶
- exception RecaptchaQuestion(website_key, website_url)[source]¶
Bases:
CaptchaQuestionThe site signals to us that a recaptcha challenge should be solved.
- type = 'g_recaptcha'¶
- website_key = None¶
- website_url = None¶
- exception GeetestV4Question(website_url, gt)[source]¶
Bases:
CaptchaQuestionThe site signals to us that a geetestv4 challenge should be solved.
- type = 'GeeTestTaskProxyless'¶
- website_url = None¶
- gt = None¶
- exception RecaptchaV3Question(website_key, website_url, action=None, min_score=None, is_enterprise=False)[source]¶
Bases:
CaptchaQuestionThe site signals to us that a recaptchav3 challenge should be solved.
- type = 'g_recaptcha'¶
- website_key = None¶
- website_url = None¶
- action = None¶
- min_score = None¶
- is_enterprise = False¶
- exception FuncaptchaQuestion(website_key, website_url, sub_domain=None, data=None)[source]¶
Bases:
CaptchaQuestionThe site signals to us that a Funcaptcha challenge should be solved.
- type = 'funcaptcha'¶
- website_key = None¶
- website_url = None¶
- sub_domain = None¶
- data = None¶
Optional additional data, as a dictionary.
For example, a site could transmit a ‘blob’ property which you should get, and transmit as {‘blob’: your_blob_value} through this property.