| 94 | } |
| 95 | |
| 96 | class Env { |
| 97 | constructor(name) { |
| 98 | this.name = name |
| 99 | this.username = ''; |
| 100 | this.cookie = ''; |
| 101 | this.cookies = cookies; |
| 102 | this.index = ''; |
| 103 | this.ext = []; |
| 104 | this.msg = []; |
| 105 | this.delimiter = ''; |
| 106 | this.filename = '' |
| 107 | this.lz = '' |
| 108 | this.appId = ''; |
| 109 | this.algo = {}; |
| 110 | this.bot = false; |
| 111 | this.expire = false; |
| 112 | this.accounts = {}; |
| 113 | } |
| 114 | |
| 115 | async run(data = { |
| 116 | wait: [1000, 2000], |
| 117 | bot: false, |
| 118 | delimiter: '', |
| 119 | o2o: false, |
| 120 | random: false, |
| 121 | once: false, |
| 122 | blacklist: [], |
| 123 | whitelist: [] |
| 124 | }) { |
| 125 | console.log('运行参数:', data); |
| 126 | this.filename = process.argv[1]; |
| 127 | console.log(`${this.now()} ${this.name} ${this.filename} 开始运行...`); |
| 128 | this.start = this.timestamp(); |
| 129 | let accounts = ""; |
| 130 | if (__dirname.includes("magic")) { |
| 131 | accounts = this.readFileSync( |
| 132 | '/home/magic/Work/wools/doc/account.json') |
| 133 | } else { |
| 134 | if (fs.existsSync('utils/account.json')) { |
| 135 | accounts = this.readFileSync('utils/account.json') |
| 136 | } else { |
| 137 | accounts = this.readFileSync('account.json') |
| 138 | } |
| 139 | } |
| 140 | accounts ? JSON.parse(accounts).forEach( |
| 141 | o => this.accounts[o.pt_pin] = o.remarks) : '' |
| 142 | await this.config() |
| 143 | if (data?.delimiter) { |
| 144 | this.delimiter = data?.delimiter |
| 145 | } |
| 146 | if (data?.bot) { |
| 147 | this.bot = data.bot; |
| 148 | } |
| 149 | |
| 150 | console.log('原始ck长度', cookies.length) |
| 151 | if (data?.blacklist?.length > 0) { |
| 152 | for (const cki of this.__as(data.blacklist)) { |
| 153 | delete cookies[cki - 1]; |
nothing calls this directly
no outgoing calls
no test coverage detected