captcha_oxide/lib.rs
1//! A high level async library that allows you to use the 2captcha API
2//! to solve various types of captcha puzzles
3//!
4//! # Example
5//! ```no_run
6//! use captcha_oxide::{
7//! CaptchaSolver,
8//! captcha::types::recaptcha::v3::RecaptchaV3,
9//! Captcha,
10//! };
11//!
12//! use url::Url;
13//!
14//! async fn example() -> captcha_oxide::Result<()> {
15//! let solver = CaptchaSolver::new("YOUR TWOCAPTCHA API KEY");
16//!
17//! let args = RecaptchaV3::builder()
18//! .website_url(Url::parse("https://someurl.com")?)
19//! .website_key("SITE_KEY")
20//! .min_score(0.3)
21//! .build();
22//!
23//! let solution = solver
24//! .solve(args)
25//! .await?
26//! .solution
27//! .g_recaptcha_response;
28//!
29//! assert!(!solution.is_empty());
30//!
31//! Ok(())
32//! }
33//! ```
34//!
35//! # Should I migrate from v5.2.0?
36//! Unless you need `TencentCaptcha` or `AtbCaptcha`, there is no
37//! need to migrate if you have an existing project using version
38//! `5.2.0`.
39//!
40//! Version `6.0.0` is a restructure of the API and the macros
41//! aimed at making them more convinient to maintain, especially
42//! as the previous macro system was cumbersome and had very poor
43//! syntax. If you are creating a new project, we do recommend using
44//! version 6.
45//!
46//! # MSRV
47//! The Minimum Supported Rust Version is 1.70.0
48
49#![deny(clippy::pedantic, clippy::nursery, clippy::mod_module_files)]
50#![forbid(unsafe_code)]
51
52pub(crate) const SOFT_ID: u16 = 4143;
53
54pub mod captcha;
55mod captcha_solver;
56pub mod cookie;
57mod language_pool;
58mod prelude;
59pub mod proxy;
60mod two_captcha;
61
62pub use captcha::Captcha;
63pub use captcha_solver::CaptchaSolver;
64pub use prelude::{Error, Result};