pub struct TokenCaptcha {
pub captcha_interface: CaptchaInterface,
}
Expand description
Token captcha solving method - ReCaptchaV2, ReCaptchaV3, FunCaptcha, GeeTest, Turnstile.
§Examples
For RecaptchaV2TaskProxyless
.
Other captcha types works same, you need check docs and set correct task_payload
.
use serde_json::json;
use rust_anticaptcha::core::enums::TokenTaskType;
use rust_anticaptcha::token_captcha::TokenCaptcha;
async fn run() {
let map = json!({
"websiteKey": "6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u",
"websiteURL":"https://rucaptcha.com/demo/recaptcha-v2"
});
let mut image_to_text_client = TokenCaptcha::new("API_KEY".to_string());
image_to_text_client.captcha_handler(TokenTaskType::RecaptchaV2TaskProxyless, &map).await;
}
§Notes
Read more here:
https://anti-captcha.com/apidoc/task-types/RecaptchaV2TaskProxyless
https://anti-captcha.com/apidoc/task-types/RecaptchaV3TaskProxyless
https://anti-captcha.com/apidoc/task-types/RecaptchaV2EnterpriseTaskProxyless
https://anti-captcha.com/apidoc/task-types/RecaptchaV3Enterprise
https://anti-captcha.com/apidoc/task-types/FunCaptchaTaskProxyless
https://anti-captcha.com/apidoc/task-types/GeeTestTaskProxyless
https://anti-captcha.com/apidoc/task-types/TurnstileTaskProxyless
Fields§
§captcha_interface: CaptchaInterface
Implementations§
Source§impl TokenCaptcha
impl TokenCaptcha
Sourcepub async fn captcha_handler(
&mut self,
captcha_type: TokenTaskType,
task_payload: &Value,
) -> Value
pub async fn captcha_handler( &mut self, captcha_type: TokenTaskType, task_payload: &Value, ) -> Value
Method run captcha solving logic
§Arguments
captcha_type
- One of image captcha types from TokenTaskType
task_payload
- JSON with captcha task payload
§Examples
use serde_json::json;
use rust_anticaptcha::core::enums::TokenTaskType;
use rust_anticaptcha::token_captcha::TokenCaptcha;
async fn run() {
let map = json!({
"websiteKey": "6LfD3PIbAAAAAJs_eEHvoOl75_83eXSqpPSRFJ_u",
"websiteURL":"https://rucaptcha.com/demo/recaptcha-v2"
});
let mut image_to_text_client = TokenCaptcha::new("API_KEY".to_string());
image_to_text_client.captcha_handler(TokenTaskType::RecaptchaV2TaskProxyless, &map).await;
}