# bad.log(by, path)
Remove all lines from this.accounts that includes 'email' attr in 'path' file Update this.accounts
Parameters
Name | Types | Description |
---|---|---|
by | string |
any attribute from this.accounts[0] |
path | string |
array |
Returns
Array
# bad.log(by, path)
More faster way than removeAccountsBy more than x10 Remove all lines from this.accounts that includes 'email' attr in 'path' file Update this.accounts
Parameters
Name | Types | Description |
---|---|---|
by | string |
any attribute from this.accounts[0] |
path | string |
array |
Returns
Array
# bad.log(by, path)
DEPRECATED use this.removeAccountsBy instead
Parameters
Name | Types | Description |
---|---|---|
by | string |
any attribute from this.accounts[0] |
path | string |
path to file whose lines must be removed from this.accounts |
Returns
Array
# createFilesIfNotExists(filesObj)
Creates files if they are not exists But directories must be created by hand
Parameters
Name | Types | Description |
---|---|---|
filesObj | object |
like {loggedIn: './loggedIn.log'} |
# loadAccounts(opts, opts.path, opts.leftName, opts.rightName, opts.delimiter, opts.leftCallback, opts.rightCallback)
- load accounts from file 2. build they in like {email, password}[] You can define own methods for mutate left and right line half. Please don`t load more than 1kk lines. It so slow.
Parameters
Name | Types | Description |
---|---|---|
opts | object |
string |
opts.path | string |
required. Path to file with accounts |
opts.leftName | string |
default 'email'. The of the left half |
opts.rightName | string |
default 'password'. The of the right half. |
opts.delimiter | string |
default /: |
opts.leftCallback | function |
default null. May be (email) => {} Must return null, string or object |
opts.rightCallback | function |
default null. May be (password) => {} Must return null, string or object |
Returns
Array
# proxy.txt(path, silent)
todo http proxy support File contain lines like: "128.12.1.1:1080" Update this.proxies
Parameters
Name | Types | Description |
---|---|---|
path | string |
path to file |
silent | boolean |
is need showing message after success loading proxies |
Returns
Array
# registered.log()
DEPRECATED use this.loadAccounts instead
Parameters
Name | Types | Description |
---|---|---|
|
Returns
Array
like {login, email, password}[]
# returnAgent(agent, timeout)
push(agent) after 'timeout'
Parameters
Name | Types | Description |
---|---|---|
agent | Agent |
|
timeout | number |
Returns
undefined
# save(path, line, metricsName)
write content to file + '\n' and increase metrics counter if needed
Parameters
Name | Types | Description |
---|---|---|
path |
|
destination path |
line |
|
line to write |
metricsName |
|
what metrics must be increased by 1 |
# setMetrics(metrics)
DEPRECATED, use this.showMetics instead Create metrics object like counter to monitor custom metrics
Parameters
Name | Types | Description |
---|---|---|
metrics | object |
object of string like {'good':0, 'bad':0} |
# showMetrics(metrics, interval)
NEW this method replace this.setMetrics and this.startShowingMetrics in to one method Create metrics object like counter to monitor custom metrics start interval showing metrics
Parameters
Name | Types | Description |
---|---|---|
metrics | object |
object of string like {'good':0, 'bad':0} |
interval | number |
ms, interval of console.log |
# start(opts, opts.THREADS, opts.handlerFunc, opts.whatToQueue, opts.startMessage, opts.drainMessage, opts.drainCallback, opts.useProxy)
Start processing
Parameters
Name | Types | Description |
---|---|---|
opts | object |
|
opts.THREADS | number |
threads amount |
opts.handlerFunc | function |
required. |
opts.whatToQueue | string |
from this. context. ('accounts' or 'agents') |
opts.startMessage | string |
this will print on bruteforce start checking |
opts.drainMessage | string |
this will print when all tasks are processed |
opts.drainCallback | function |
required. Callback when all tasks are processed |
opts.useProxy | boolean |
default false |
# startShowingMetrics(interval)
DEPRECATED, use this.showMetics instead start interval showing metrics
Parameters
Name | Types | Description |
---|---|---|
interval | number |
ms, interval of console.log |
# timeout(ms)
Async timeout implementation
Parameters
Name | Types | Description |
---|---|---|
ms | number |
Returns
Promise<any>
# valid_proxy.txt(path, type)
sometimes this works not "this.loadProxyAgentsV2" using const HttpsProxyAgent = require('https-proxy-agent'); const HttpProxyAgent = require('http-proxy-agent'); const SocksProxyAgent = require('socks-proxy-agent'); this libs
Parameters
Name | Types | Description |
---|---|---|
path | string |
path to file |
type | string |
default='http'. ('http' or 'https' or 'socks') |
Returns
Array
# valid_proxy.txt(path, type)
sometimes this works not "this.loadProxyAgents" using const ProxyAgent = require('proxy-agent'); this libs
Parameters
Name | Types | Description |
---|---|---|
path | string |
path to file |
type | string |
default='http'. ('http' or 'https' or 'socks') |
Returns
Array
# proxy.txt(startPath, endPath, proxyType, THREADS, timeout)
Parameters
Name | Types | Description |
---|---|---|
startPath |
|
file to load proxy. Lines like 123.321.321.33:31233 |
endPath |
|
file to store valid proxies |
proxyType |
|
'http' or 'socks' |
THREADS |
|
amount of thread running in parallel |
timeout |
|
amount of milliseconds to wait response |
# getSetCookies(rResponse)
retrieve 'set-cookie' header from 'request'.response
Parameters
Name | Types | Description |
---|---|---|
rResponse |
|
Returns
*
# parse(source, start, end)
Retrieve sub string by passing 'start' and 'end' substring example: parse('123baaz321', '123', '321') will return 'baaz'
Parameters
Name | Types | Description |
---|---|---|
source | string |
source string |
start | string |
start substring |
end | string |
end substring |
Returns
string
# r(config, agent, retryCount)
Send request and return promise.
Parameters
Name | Types | Description |
---|---|---|
config |
|
- all the same for 'request' module |
agent |
|
- for convenience. agent by 'request'.agent |
retryCount |
|
- amount of retries if not called 'timeout' |
Returns
Promise<{response, body}>
# rCloudFlare(config, agent, retryCount)
by pass cloudflare and work same as this.r
Parameters
Name | Types | Description |
---|---|---|
config |
|
- all the same for 'request' module |
agent |
|
- for convenience. agent by 'request'.agent |
retryCount |
|
- amount of retries if not called 'timeout' |
Returns
Promise<void>