#captcha #solver #hcaptcha #hcoptcha

hcop

为 https://hcoptcha.online/login 提供的 Rust 封装。

1 个不稳定版本

0.1.0 2023年12月24日

#18#captcha

Apache-2.0 协议

12KB
227 行代码(不包括注释)

HCop

HCoptcha API 的 Rust 封装。

使用方法

use hcop::HCop;

fn main() {
    let hcop = Hcop::new("YOUR_API_KEY".to_string());
    match hcop.get_user_data() {
        Ok(user_data) => {
            println!("{} has {}$", user_data.username, user_data.balance);
        }
        Err(e) => {
            println!("{}", e.message);
            return;
        }
    }

    let task = hcop.create_hcaptcha_task(
        "a5f74b19-9e45-40e0-b45d-47ff91b7a6c2".to_string(),
        "accounts.hcaptcha.com".to_string(),
        "IP:PORT OR USER:PASS@IP:PORT".to_string(),
        None
    );

    let start = std::time::Instant::now();

    match task {
        Ok(task) => {
            println!("Task ID: {}", task.task_id);

            loop {
                let result = task.get_result();
                match result {
                    Ok(result) => {
                        if result.status == TaskStatus::Completed {
                            break;
                        }
                    }
                    Err(e) => {
                        println!("{}", e.message);
                        return;
                    }
                }
                std::thread::sleep(std::time::Duration::from_millis(100));
            }
        }
        Err(e) => {
            println!("{}", e.message);
            return;
        }
    }
    let duration = start.elapsed();
    println!("Solved in {:?}", duration);
}

贡献

欢迎 Pull requests。对于重大更改,请先打开一个问题来讨论您想要更改的内容。

依赖项

~3–18MB
~232K SLoC