npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

yandex-smartcaptcha-solver

v2.0.0

Published

Automatic Yandex SmartCaptcha solver using XEvil OCR service

Readme

yandex-smartcaptcha-solver

Автоматическое решение Yandex SmartCaptcha через OCR-сервис XEvil.

Установка

npm install yandex-smartcaptcha-solver

Требования

  • Node.js >= 14.0.0
  • Запущенный экземпляр XEvil с доступным HTTP API

Быстрый старт

const YandexSmartCaptchaSolver = require('yandex-smartcaptcha-solver');

const solver = new YandexSmartCaptchaSolver(
  {
    xevilUrl: 'http://127.0.0.1:80',
    xevilApiKey: 'YOUR_API_KEY',
    siteUrl: 'https://example.com/page-with-captcha',
    siteKey: 'YOUR_SITE_KEY',
  },
  {
    debug: true,
  }
);

const result = await solver.solve();
console.log(result.token); // dD0x...

Конфигурация

Обязательные параметры (config)

| Параметр | Тип | Описание | |---|---|---| | xevilUrl | string | URL XEvil сервера. Например: http://127.0.0.1:80 | | xevilApiKey | string | API ключ для XEvil | | siteUrl | string | Полный URL страницы с капчей | | siteKey | string | Site key Yandex SmartCaptcha | | coreName | string | (опционально) Имя ядра XEvil |

Дополнительные опции (options)

| Параметр | Тип | По умолчанию | Описание | |---|---|---|---| | userAgent | string | Chrome 120 UA | User-Agent браузера | | debug | boolean | false | Подробное логирование | | saveImages | boolean | false | Сохранять изображения капч на диск | | imagesDir | string | ./captcha_images | Папка для сохранения изображений | | humanDelayMin | number | 2000 | Минимальная задержка перед отправкой ответа (мс) | | humanDelayMax | number | 4000 | Максимальная задержка перед отправкой ответа (мс) | | timeout | number | 45000 | Таймаут HTTP запросов (мс) | | maxRetries | number | 3 | Повторы при сетевых ошибках | | retryDelay | number | 2000 | Задержка между повторами (мс) | | proxyMaxAttempts | number | 5 | Повторы при недоступности прокси | | proxyRetryDelay | number | 5000 | Задержка между попытками прокси (мс) |

API

solve(proxy?)

Решает капчу. Возвращает { status: 'ok', token: string }.

// Без прокси
const result = await solver.solve();

// С SOCKS5 прокси
const result = await solver.solve({
  host: '127.0.0.1',
  port: 1080,
  username: 'user',   // опционально
  password: 'pass',   // опционально
});

console.log(result.token); // передаётся на сайт как spravka-токен

solveWithRetry(maxAttempts?, retryDelay?, proxy?)

Решает капчу с автоматическими повторными попытками при неудаче.

| Параметр | По умолчанию | Описание | |---|---|---| | maxAttempts | 3 | Максимальное количество попыток | | retryDelay | 3000 | Задержка между попытками (мс) | | proxy | null | Настройки SOCKS5 прокси |

const result = await solver.solveWithRetry(5, 4000, {
  host: '127.0.0.1',
  port: 1080,
});

Примеры

Базовое использование

const YandexSmartCaptchaSolver = require('yandex-smartcaptcha-solver');

async function main() {
  const solver = new YandexSmartCaptchaSolver({
    xevilUrl: 'http://127.0.0.1:80',
    xevilApiKey: 'YOUR_API_KEY',
    siteUrl: 'https://example.com',
    siteKey: 'FEXfAbHQsToo97VidNVk3j4dqp-GuAbDp-amaEHNKMg=',
  });

  try {
    const result = await solver.solveWithRetry(3);
    console.log('Token:', result.token);
    // Используйте token в запросе к сайту
  } catch (err) {
    console.error('Не удалось решить капчу:', err.message);
  }
}

main();

С прокси и сохранением изображений

const solver = new YandexSmartCaptchaSolver(
  {
    xevilUrl: 'http://127.0.0.1:80',
    xevilApiKey: 'YOUR_API_KEY',
    siteUrl: 'https://example.com',
    siteKey: 'YOUR_SITE_KEY',
  },
  {
    debug: true,
    saveImages: true,
    imagesDir: './captcha_images',
  }
);

const proxy = { host: '127.0.0.1', port: 1080 };
const result = await solver.solve(proxy);

Как это работает

  1. Отправляется первый запрос к smartcaptcha.yandexcloud.net для получения ключа капчи
  2. Отправляется второй запрос — получаем URL изображения с символами
  3. Изображение скачивается и отправляется в XEvil для OCR-распознавания
  4. Распознанный текст кодируется и отправляется обратно в Yandex
  5. При успехе возвращается spravka-токен для передачи на целевой сайт

Лицензия

MIT © SH3EL1T