Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Commit

Permalink
add env variables, tweaked default delays
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbasPL committed Nov 8, 2023
1 parent 9801793 commit ba8fda5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "aero2solver"
description = "Solve Aero2 captchas automatically"
authors = ["nezu <[email protected]>"]
version = "0.2.0"
version = "0.2.1"
edition = "2021"

[dependencies]
Expand All @@ -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"] }
clap = { version = "4.4.7", features = ["derive", "string", "env"] }
14 changes: 7 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit ba8fda5

Please sign in to comment.