dart_anticaptcha 1.0.9 dart_anticaptcha: ^1.0.9 copied to clipboard
Easy to use library for solving captcha
The solution of the captcha is carried out at the expense of the resource workers - https://anti-captcha.com To solve the captcha, you need to register on the resource and top up your balance. Documentation - https://anti-captcha.com/apidoc
Installation #
dart pub add dart_anticaptcha
or
dependencies:
dart_anticaptcha: ^1.0.9
Usage #
The easiest way to use this library is to use the memoryImageToBase64() function. This function is intended for converting an image to base64 and further uploading it to the resource to solve the captcha. Also, to get base64 images from the site, you need to use the networkImageToBase64() function.
import 'package:dart_anticaptcha/dart_anticaptcha.dart';
void main() async {
String anticaptcha_token = 'YOUR_TOKEN';
String memoryImage = 'captcha.jpeg';
String networkImage = 'https://api.vk.com/captcha.php?sid=605143621908&s=1';
AntiCaptcha anticaptcha = AntiCaptcha(anticaptcha_token);
String? imgbase64 = await anticaptcha
.networkImageToBase64(networkImage); //memoryImage or networkImage
Map headers = {
"clientKey": anticaptcha_token,
"task": {"type": "ImageToTextTask", "body": imgbase64}
};
dynamic result = await anticaptcha.returnResult(headers, imgbase64!);
print(result);
}