tauri-plugin-outis-api
v0.5.0
Published
Tauri plugin for reading captchas.
Downloads
90
Readme
Tauri Plugin: Captcha Breaker
A drop-in Tauri plugin for local, offline captcha solving.
Powered by captcha-engine with a custom-trained ONNX model.
Features
- Zero Runtime Config: No model paths, no downloads, no network requests at runtime.
- Offline Ready: The model is downloaded at build time and embedded directly into the application binary.
- Fast: ~50ms inference time on CPU.
Installation
Add dependency:
Full feature set (recommended):
[dependencies] tauri-plugin-captcha-breaker = { git = "https://github.com/milangress/voucher-captcha-system", branch = "main" }Register the plugin in
src-tauri/src/lib.rs:#[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() .plugin(tauri_plugin_captcha_breaker::init()) .run(tauri::generate_context!()) .expect("error running app"); }Allow permissions in
src-tauri/capabilities/default.json(or similar):{ "permissions": [ "captcha-breaker:default" ] }
Usage (Frontend)
import { invoke } from '@tauri-apps/api/core';
// 1. Initialize (Optional)
// Pre-loads the model into memory. If you skip this, it auto-loads on first use.
// Doing this at app startup makes the first user interaction feel instant.
await invoke('plugin:captcha-breaker|init_model');
// 2. Break a Captcha
try {
const result = await invoke<string>('plugin:captcha-breaker|break_captcha', {
// You can pass:
// - A URL (http://...) -> Plugin will download it
// - A Data URI (data:image/png;base64,...)
// - A local file path (/Users/...)
imagePath: 'https://example.com/captcha.png'
});
console.log('Captcha Result:', result);
} catch (error) {
console.error('Failed to break captcha:', error);
}How it Works (Model Downloading)
You might wonder where the model comes from if you don't provide it.
- Build Time: When you run
cargo build, thecaptcha-enginebuild script checks for the model file (assets/captcha_schwarz_finetuned.onnx). - Auto-Download: If the file is missing (e.g., in a CI environment or fresh clone), it automatically downloads the latest version from HuggingFace (
Milang/captcha-solver) to Rust'sOUT_DIR. - Embedding: The model bytes (~19MB) are then compiled into the binary itself.
- Runtime: When your app runs, the plugin loads the model directly from memory. This guarantees the model is always available and version-matched to the code.
