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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cybersify/solvecaptcha

v0.0.10

Published

This is a boilerplate of an Apify actor.

Downloads

4

Readme

Install

You can find some snippet code to resolve captchas with solvecaptcha.net

cd anticaptcha folder

npm i @cybersify/solvecaptcha


Usage

// this illustrate available captcha on site https://solvecaptcha.net

const { solveCaptchaV2 }  = require("@cybersify/solvecaptcha")  
const params = {
    key: 'x|XOWpjuDQYBHIOqXr0X1bYuYkMJKsWWPO4xxxxxxxxx', // account key at solvedcaptcha.net
    method: 'RecaptchaV2TaskProxyless',
    page_url: 'https://ct.captcha-xxxx.com', // url destination
    site_key: '6LccSjEUAAAAANCPhaM2c-WiRxCZ5CzsjR_xxx', // key site google Captcha,
};

(async () => {
 
    try {
        // solve the google captcha with API
        console.log("* Waiting g-recaptcha-reponse");
        const token = await solveCaptchaV2(params, api);
        console.log('* Receive g-recaptcha-reponse: ' + token);
        
        // unsccessful case 
        if (token.includes('ERROR') || token.includes('CAPCHA_NOT_READY')){
            process.exit(1)
        }
 
    } catch (error) {
        console.log(error);
    }
   
  })();

// this illustrate available captcha on site https://solvecaptcha.net
const { solveGeeTest }  = require("@cybersify/solvecaptcha")  
const puppeteer = require('puppeteer');
const Apify = require('apify');


const params = {
    key: 'x|XOWpjuDQYBHIOqXr0X1bYuYkMJKsWWPO4xxxxxxxxx', // account key at solvedcaptcha.net
    method: 'GeeTestTaskProxyless',
    gt:'1e505deed3832c02c96ca5abe70dxxxx',
    page_url: 'https://www.xxxxxsales.com.au/',
    geetestApiServerSubdomain:'api-na.geetest.com'
};

(async () => {
 
  
    const browser = await puppeteer.launch({
        headless: false,
        slowMo: 250,
        args: [
             '--disable-web-security',
             '--disable-features=IsolateOrigins,site-per-process',
             '--user-data-dir=./.config/google-chrome'
        ]
    });   
       
    const page = await browser.newPage();
   try {

        await resolveGeetestCaptcha(page,params);        

    } catch (err) {
        console.log('ERR:', err.message);
        await browser.close();
        process.exit(1);

    } finally {
        await browser.close();
        process.exit(0);

    }
   
  })();

async function resolveGeetestCaptcha(page , params){

    await Apify.utils.puppeteer.blockRequests(page, {
        extraUrlPatterns: ['api.geetest.com', 'api-na.geetest.com'],
    });

    await page.goto(params.page_url, {waitUntil: 'networkidle0'});

    let content = await page.content();


    // waiting loaded iFrame DataDome
    await page.waitForSelector('iframe');
     const iframe = page.mainFrame().childFrames()[0];

    let str = await iframe.content(); 
    let arr = str.split(",");
    for (i=0; i < arr.length ; i ++){
        if(arr[i].includes(" challenge:") > 0){
            arr_challenge = arr[i].split(":");
            params.challenge = arr_challenge[1].replace(/[^0-9a-zA-Z]/g,'');
        }
    }
        
    if(params.challenge != null && params.challenge != undefined){
        console.log("*geetest_form: True");
    }else{
        console.log("*geetest_form: False");
    }

    if(params.challenge != null && params.challenge != undefined){
        params.websiteURL=params.page_url;
        const token = await solveGeeTest(params);
        console.log(token);
            
        // unsccessful case 
        if (token.challenge == undefined || token.challenge == null){
            await browser.close();
            process.exit(1)
        }
            
        const elementHandle = await page.$('iframe');
        const frameContentFrame = await elementHandle.contentFrame();
        await frameContentFrame.evaluate(async (captchaResult) => {
            
            geetestResponse = {
                geetest_challenge: captchaResult.challenge,
                geetest_validate: captchaResult.validate,
                geetest_seccode: captchaResult.seccode,
            };

            captchaCallback(); // maybe use different name
            
        }, token);
                
    }

}  

Motivation

These days captchas are unfortunately everywhere, with reCAPTCHA having the biggest "market share" in that space (> 80%). The situation got really bad, with privacy minded users (tracking blocker, VPNs) being penalized heavily and having to solve a lot of reCAPTCHA challenges constantly while browsing the web.

These small codes allow us to get automatically google token from Solvecaptcha Service and bypass google's protection. It is very important for crawler's activites.