Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Image = require('image-binary');
- const client = require('rucaptcha-client')
- .create('ебанный ключ лиминина');
- function Captcha(key){
- }
- Captcha.prototype.get = function(url) {
- return new Promise((resolve, reject) => {
- client.balance.then((num) => {
- balance = num;
- return Image.create(url);
- }).then((image) => {
- client.image = image;
- return client.solve({language: 2, regsense: 0});
- }).then((answer) => {
- console.log('Ответ: ' + answer.text + ' | balance: ' + balance);
- resolve({"balance": balance,
- "answer": answer.text})
- }).catch((err) => {
- reject(err)
- });
- })
- };
- module.exports = Captcha;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement