use rustenium_identity::{preset, IdentitySession};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let identity = match std::env::args().nth(1) {
Some(arg) => {
let id: u64 = arg.parse()?;
preset::get_by_id(id)?
}
None => preset::random(),
};
println!(
"Launching preset #{:?}: {:?} {} / {:?} / {}",
identity.id, identity.os, identity.os_version, identity.browser, identity.gpu.webgl_renderer
);
let _session = IdentitySession::launch(identity).await?;
println!("Browser is up with the identity applied.");
println!("Visit a detection site in the opened window (e.g. creepjs / bot.sannysoft.com).");
println!("Press Ctrl-C to quit.");
tokio::signal::ctrl_c().await?;
println!("\nShutting down.");
Ok(())
}