1.9.1 • Published 5 years ago
@stormeio-llc/harvester-manager v1.9.1
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
5 years ago
1.9.0
5 years ago
1.8.24
5 years ago
1.8.23
5 years ago
1.8.22
5 years ago
1.8.21
5 years ago
1.8.20
5 years ago
1.8.19
5 years ago
1.8.18
5 years ago
1.8.17
5 years ago
1.8.16
5 years ago
1.8.15
5 years ago
1.8.14
5 years ago
1.8.13
5 years ago
1.8.12
5 years ago
1.8.11
5 years ago
1.8.10
5 years ago
1.8.9
5 years ago
1.8.8
5 years ago
1.8.7
5 years ago
1.8.6
5 years ago
1.8.5
5 years ago
1.8.4
5 years ago
1.8.3
5 years ago
1.8.2
5 years ago
1.8.1
5 years ago
1.8.0
5 years ago
1.7.2
5 years ago
1.7.1
5 years ago
1.7.0
5 years ago
1.6.1
5 years ago
1.6.0
5 years ago
1.5.0
5 years ago
1.3.0
5 years ago
1.2.3
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.0
5 years ago