Menu

NodeJS اور Axios کے ساتھ reCaptcha V2 کو نظرانداز کرنا


آپ کیا سیکھیں گے

  • آپ NodeJS اسکرپٹ کے ساتھ Recaptcha کے ساتھ یہ فارم جمع کروانے کا طریقہ سیکھیں گے۔
  • anticaptchaofficial اور axios npm ماڈیولز انسٹال اور درآمد کریں۔
  • NodeJS اسکرپٹ لکھنے کا طریقہ سیکھیں جو Recaptcha V2 کو حل کرتی ہے اور فارم جمع کرتی ہے۔

سورس کوڈ:


//npm install @antiadmin/anticaptchaofficial axios
const axios = require('axios');
const ac = require('@antiadmin/anticaptchaofficial');

// Set your Anti-Captcha API key
ac.setAPIKey('API_KEY_HERE');

// Solve Recaptcha V2
ac.solveRecaptchaV2Proxyless('https://anti-captcha.com/demo/?page=recaptcha_v2_textarea', '6LfydQgUAAAAAMuh1gRreQdKjAop7eGmi6TrNIzp')
    .then(recaptchaToken => {
        console.log('Recaptcha token:', recaptchaToken);

        // Submit form data with Recaptcha token
        const formData = {
            login: 'test', // Replace with actual login data
            pass: 'test', // Replace with actual password data
            'g-recaptcha-response': recaptchaToken
        };

        const headers = {
            'Content-Type': 'application/x-www-form-urlencoded',
            'Referer': 'https://anti-captcha.com/demo/?page=recaptcha_v2_textarea',
            // Add any other necessary headers from your curl command
        };

        axios.post('https://anti-captcha.com/demo/submit1.php', formData, { headers })
            .then(response => {
                console.log('Response from server:', response.data);
                // Check if Recaptcha test passed or failed based on response
                if (response.data.includes('Recaptcha test passed')) {
                    console.log('Recaptcha test passed!');
                } else {
                    console.log('Recaptcha test failed.');
                }
            })
            .catch(error => {
                console.error('Error submitting form:', error);
            });
    })
    .catch(error => {
        console.error('Error solving Recaptcha:', error);
    });

نوڈ جے ایس اور ایک IDE مرتب کریں۔

  • Node JS: اپنے آپریٹنگ سسٹم کے لیے Node JS ڈاؤن لوڈ کریں یہاں
  • کوڈ ایڈیٹر: تجویز کردہ VS Code یا Atom۔ دونوں مفت IDE ہیں۔

anticaptchaofficial اور axios npm ماڈیولز انسٹال اور درآمد کریں۔

mkdir tutorial
cd tutorial
npm init -y
npm install @antiadmin/anticaptchaofficial axios

Github

https://github.com/anti-captcha/solving-captcha-concepts/blob/master/tutorial1.js