diff --git a/Cargo.lock b/Cargo.lock index bf56c86..ef43bff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,7 +19,7 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aero2solver" -version = "0.2.0" +version = "0.2.1" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index 692c33d..7e0f95b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "aero2solver" description = "Solve Aero2 captchas automatically" authors = ["nezu "] -version = "0.2.0" +version = "0.2.1" edition = "2021" [dependencies] @@ -11,4 +11,4 @@ anyhow = "1.0" reqwest = { version = "0.11", default-features = false, features = ["blocking"] } tl = "0.7" image = "0.24" -clap = { version = "4.4.7", features = ["derive", "string"] } \ No newline at end of file +clap = { version = "4.4.7", features = ["derive", "string", "env"] } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index bc589b2..914ecc6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,31 +18,31 @@ fn get_model_path(filename: &str) -> String { #[command(author, version, about, long_about = None)] struct Args { /// model configuration file. - #[arg(short = 'c', long, default_value_t = get_model_path("captcha.cfg"))] + #[arg(short = 'c', long, env = "AERO2_MODEL_CFG", default_value_t = get_model_path("captcha.cfg"))] model_cfg: String, /// model weights file. - #[arg(short = 'w', long, default_value_t = get_model_path("captcha.weights"))] + #[arg(short = 'w', long, env = "AERO2_WEIGHTS", default_value_t = get_model_path("captcha.weights"))] weights: String, /// model labels file. - #[arg(short = 'l', long, default_value_t = get_model_path("captcha.names"))] + #[arg(short = 'l', long, env = "AERO2_LABELS", default_value_t = get_model_path("captcha.names"))] labels: String, /// minimum confidence threshold for captcha detection (0.0 - 1.0). - #[arg(short = 't', long, default_value_t = 0.8)] + #[arg(short = 't', long, env = "AERO2_THRESHOLD", default_value_t = 0.8)] threshold: f32, /// time to wait after aero2 returns an error (in seconds). - #[arg(long, default_value_t = 5.0)] + #[arg(long, env = "AERO2_ERROR_DELAY", default_value_t = 10.0)] error_delay: f32, /// time to wait between checking for new captchas (in seconds). - #[arg(long, default_value_t = 10.0)] + #[arg(long, env = "AERO2_CHECK_DELAY", default_value_t = 10.0)] check_delay: f32, /// time to wait after successfully solving a captcha (in seconds). - #[arg(long, default_value_t = 55.0 * 60.0)] + #[arg(long, env = "AERO2_SOLVED_DELAY", default_value_t = 60.0)] solved_delay: f32, }