woob.capabilities.captcha
¶
- class CapCaptchaSolver[source]¶
Bases:
Capability
Provide 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
NotImplementedError
if CAPTCHA type is not supported- Raises
CaptchaError
in 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
bool
- 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
- Variables
url – (
str
) urlsolution – (
str
) CAPTCHA solution
- class RecaptchaJob(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 servicesolution_challenge – (
str
) Challenge ID of the solution (output value)
- class RecaptchaV2Job(id='', url=NotLoaded, backend=None)[source]¶
Bases:
SolverJob
- Variables
url – (
str
) urlsolution – (
str
) CAPTCHA solutionsite_url – (
str
) Site URL for NoCaptcha servicesite_key – (
str
) Site key for NoCaptcha service
- 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
- class ImageCaptchaJob(id='', url=NotLoaded, backend=None)[source]¶
Bases:
SolverJob
- Variables
url – (
str
) urlsolution – (
str
) CAPTCHA solutionimage – (
bytes
) data of the image to solve
- class HcaptchaJob(id='', url=NotLoaded, backend=None)[source]¶
Bases:
SolverJob
- Variables
url – (
str
) urlsolution – (
str
) CAPTCHA solutionsite_url – (
str
) Site URL for HCaptcha servicesite_key – (
str
) Site key for HCaptcha service
- class GeetestV4Job(id='', url=NotLoaded, backend=None)[source]¶
Bases:
SolverJob
- Variables
url – (
str
) urlsolution – (
str
) CAPTCHA solutionsite_url – (
str
) Site URL for Geetest servicegt – (
str
) Site domain public key
- exception UnsolvableCaptcha[source]¶
Bases:
CaptchaError
CAPTCHA is too hard or impossible
- exception InvalidCaptcha[source]¶
Bases:
CaptchaError
CAPTCHA cannot be used (e.g. invalid image format)
- exception InsufficientFunds[source]¶
Bases:
CaptchaError
Not enough funds to pay solution