Anti Captcha Solver

Auto-solve captcha

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Anti Captcha Solver
// @namespace    Anti Captcha Auto Solver
// @version      1.3
// @description  Auto-solve captcha
// @author       Shnethan
// @match        https://freeltc.online/*
// @icon         https://elixirforum.com/uploads/default/optimized/1X/4310e7de671d4920800063776e9b1f6dc268c692_2_32x32.ico
// @license      GPL-3.0-or-later
// @run-at       document-end
// @grant        none

// ==/UserScript==

(function() {
    'use strict';

    setTimeout(() => {
        const c = document.querySelector('input[data-id="anticap-checkbox"]');
        if (!c) return;
        c.disabled = false;
        c.checked  = true;
        c.dispatchEvent(new MouseEvent('click', { bubbles: true }));
    }, 1500);

    const s = ms => new Promise(r => setTimeout(r, ms));

    const w = async sel => {
        while (!document.querySelector(sel)) await s(300);
        return document.querySelector(sel);
    };

    const h = img => {
        const c = document.createElement('canvas');
        c.width = c.height = 16;
        const x = c.getContext('2d');
        x.drawImage(img, 0, 0, 16, 16);
        const d = x.getImageData(0, 0, 16, 16).data;
        return [...d].filter((_, i) => i % 4 !== 3);
    };

    const dist = (a, b) => a.reduce((sum, v, i) => sum + Math.abs(v - b[i]), 0);

    (async () => {
        try {
            const err = document.querySelector('div[data-id="anticap-feedback"].error');
            if (err && err.textContent.includes('Wrong selection. Try again.')) {
                // location.reload();
                return;
            }

            const p = await w('.anticap-preview');
            await w('.anticap-grid img');

            const i = [...document.querySelectorAll('.anticap-grid img')];
            const t = h(p);

            let b, sc = Infinity;

            for (const x of i) {
                const v = dist(t, h(x));
                if (v < sc) sc = v, b = x;
            }

            if (!b) return;

            b.style.outline = '1px solid #2196F3';

            await s(5000);
            b.click();

        } catch (e) {}
    })();

})();