1.9.1 • Published 3 years ago

@stormeio-llc/harvester-manager v1.9.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

StormeIO Harvester Manager

This is the source code in TypeScript for the harvester manager.

Usage

View tests folder to run these examples.

CapMonster

Run tsc && electron tests/capmonster.js for the test.

import { app } from 'electron';
import { v4 as uuidv4 } from 'uuid';

import Manager from '..';
import { CaptchaRequest, Harvester } from '../ts/interfaces';

async function test() {
    const HarvesterManager = new Manager();

    const id: string = uuidv4();

    // Creates the harvester
    const CapMonsterHarvester: Harvester = {
        id,
        type: 'capmonster', // 'twocaptcha', 'manual'
        //site: 'Foosites', NOTE: ONLY FOR MANUAL
        maxsolving: 1,
        key: 'b7dc9e8ff339a6f558b4b53b52d1e23a'
    }
    HarvesterManager.createHarvester(CapMonsterHarvester);

    const Request: CaptchaRequest = {
        id: uuidv4(), // This would be the task ID
        type: 1,
        site: 'Footsites',
        properties: {
            url: 'https://www.footlocker.com/',
            sitekey: '6LeXJ7oUAAAAAHIpfRvgjs3lcJiO_zMC1LAZWlSz'
        }
    }
    HarvesterManager.enqueueCaptcha(Request);
    console.log('Queued Captcha for CapMonster (Wait 15-45 seconds)')

    // Waits for a response.
    HarvesterManager.on('complete', (response) => {
        console.log('Captcha Complete!');
        console.log(JSON.stringify(response));
        // Will contain 'id' and 'token' fields.
    })
}

app.on('ready', () => test()); // Because of manual solvers! No issue when running in main process.

2Captcha (Internally 'TwoCaptcha')

Run tsc && electron tests/twocaptcha.js for the test.

import { app } from 'electron';
import { v4 as uuidv4 } from 'uuid';

import Manager from '..';
import { CaptchaRequest, Harvester } from '../ts/interfaces';

async function test() {
    const HarvesterManager = new Manager();

    const id: string = uuidv4();

    // Creates the harvester
    const TwoCaptchaHarvester: Harvester = {
        id,
        type: 'twocaptcha', // 'capmonster', 'manual'
        //site: 'Foosites', NOTE: ONLY FOR MANUAL
        maxsolving: 1,
        key: '9a10ed447a585677a7b822bfcca1f7ef'
    }
    HarvesterManager.createHarvester(TwoCaptchaHarvester);

    const Request: CaptchaRequest = {
        id: uuidv4(), // This would be the task ID
        type: 1,
        site: 'Footsites',
        properties: {
            url: 'https://www.footlocker.com/',
            sitekey: '6LeXJ7oUAAAAAHIpfRvgjs3lcJiO_zMC1LAZWlSz'
        }
    }
    HarvesterManager.enqueueCaptcha(Request);
    console.log('Queued Captcha for 2Captcha (Wait 15-45 seconds)')

    // Waits for a response.
    HarvesterManager.on('complete', (response) => {
        console.log('Captcha Complete!');
        console.log(JSON.stringify(response));
        // Will contain 'id' and 'token' fields.
    })
}

app.on('ready', () => test()); // Because of manual solvers! No issue when running in main process.
1.9.1

3 years ago

1.9.0

3 years ago

1.8.24

3 years ago

1.8.23

3 years ago

1.8.22

3 years ago

1.8.21

3 years ago

1.8.20

3 years ago

1.8.19

3 years ago

1.8.18

3 years ago

1.8.17

3 years ago

1.8.16

3 years ago

1.8.15

3 years ago

1.8.14

3 years ago

1.8.13

3 years ago

1.8.12

3 years ago

1.8.11

3 years ago

1.8.10

3 years ago

1.8.9

3 years ago

1.8.8

3 years ago

1.8.7

3 years ago

1.8.6

3 years ago

1.8.5

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.3.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago