Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. const Image = require('image-binary');
  2. const client = require('rucaptcha-client')
  3. .create('ебанный ключ лиминина');
  4. function Captcha(key){
  5.  
  6. }
  7.  
  8. Captcha.prototype.get = function(url) {
  9. return new Promise((resolve, reject) => {
  10. client.balance.then((num) => {
  11. balance = num;
  12. return Image.create(url);
  13. }).then((image) => {
  14. client.image = image;
  15. return client.solve({language: 2, regsense: 0});
  16. }).then((answer) => {
  17. console.log('Ответ: ' + answer.text + ' | balance: ' + balance);
  18. resolve({"balance": balance,
  19. "answer": answer.text})
  20. }).catch((err) => {
  21. reject(err)
  22. });
  23. })
  24. };
  25.  
  26. module.exports = Captcha;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement