use python_obfuscator::{PythonObfuscator, PythonObfuscatorResponse};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let my_python_obfuscator =
PythonObfuscator::new(Some("ABCD-ABCD-ABCD-ABCD".to_string()));
let result = my_python_obfuscator.login(true).await;
match result {
Some(PythonObfuscatorResponse::Object(obj)) => {
println!(
"Demo version status - {}",
if obj.demo.unwrap_or(false) {
"true"
} else {
"false"
}
);
println!(
"License expiration - {:?}",
obj.license_expiration
);
println!(
"Total obfuscations - {}",
obj.usages_total.unwrap_or(0)
);
println!(
"Max. source code size - {}",
obj.string_limit.unwrap_or(0)
);
}
Some(PythonObfuscatorResponse::Json(_)) => {}
None => {
return Err("Something unexpected happen while trying to login to the service.".into());
}
}
Ok(())
}