-
Notifications
You must be signed in to change notification settings - Fork 312
/
Copy pathquzanmi.js
427 lines (402 loc) · 17.2 KB
/
quzanmi.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
/**
变量名 qzmCookie 抓包 x-qzm-token 每天0.6,满10提现,绑定支付宝时会自动提现0.3,秒到,
*/
const $ = new ENV("趣攒米视频任务", ["qzmCookie"]);
const cookieArr = $.qzmCookie.split("&");
class QZM {
constructor(ck, index) {
this.ck = ck.split("#")[0];
this.index = ++index;
this.oaid = this.randomString(16);
this.androidId = this.randomString(16);
}
randomString(length) {
// const table = "0123456789ABCDEF";
const table = "0123456789abcdef";
const _0x5ddc9a = {
length: length
};
return Array.from(_0x5ddc9a, () => table[Math.floor(Math.random() * table.length)]).join("");
}
randomStringNum(length) {
// const table = "0123456789ABCDEF";
const table = "0123456789";
const _0x5ddc9a = {
length: length
};
return Array.from(_0x5ddc9a, () => table[Math.floor(Math.random() * table.length)]).join("");
}
async main() {
const info = await this.getUserInfo();
if (!info) {
return void 0;
}
try {
$.log(`账号[${this.index}]【${this.nickName}】 获取任务列表`)
const tasks = await this.taskList()
$.log(`账号[${this.index}]【${this.nickName}】 刷新令牌`)
await this.access()
for (const task of tasks) {
const source = task.source;
$.log(`账号[${this.index}]【${this.nickName}】 开始任务 ${task.name}`)
for (let i = 0; i < 10; i++) {
try {
$.log(`账号[${this.index}]【${this.nickName}】 假装看广告 ${i+1}`)
await this.ecpm();
}catch (e) {
console.log(e)
}
await $.wait(10000)
}
try {
$.log(`账号[${this.index}]【${this.nickName}】 领取奖励`)
const re = await this.reward(source)
if (re){
$.log(`账号[${this.index}]【${this.nickName}】 领取奖励成功`)
}else {
$.log(`账号[${this.index}]【${this.nickName}】 领取奖励失败`)
}
}catch (e) {
console.log(e)
}
}
} catch (e) {
console.log(e)
}
try {
$.log(`账号[${this.index}]【${this.nickName}】 兑换金币`)
await this.getUserInfo()
if (this.point>=1000){
await this.trade(this.point)
}else {
$.log(`账号[${this.index}]【${this.nickName}】 当前金币数量不可兑换`)
}
}catch (e) {
console.log(e)
}
}
async getUserInfo() {
const options = {
'method': 'GET',
'url': 'https://api.quzanmi.com/api/user/info/mine',
'headers': {
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Origin': 'http://anh5.quzanmi.com',
'Pragma': 'no-cache',
'Referer': 'http://anh5.quzanmi.com/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'cross-site',
'User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950',
'sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?1',
'sec-ch-ua-platform': '"Android"',
'x-qzm-aid': `|${this.oaid}|${this.androidId}`,
'x-qzm-bundle': 'com.zhangwen.quzanmi|Xiaomi|13|1.0.0',
'x-qzm-device': 'android',
'x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),
'x-qzm-token': this.ck,
}
};
const res = await $.request(options);
if (res.code === 2000) {
this.id = res.data.id;
this.phone = res.data.phone_number;
this.nickName = res.data.nickname;
this.realName = res.data.realname;
this.score = res.data.score;
this.today_income = res.data.today_income;
this.banlance = res.data.balance;
this.payment_num = res.data.payment_num;
this.point = res.data.point;
this.total_balance = res.data.total_balance;
// console.log( res.data)
$.log(`账号[${this.index}]【${this.nickName}】 真名: ${this.realName} 手机号: ${this.phone}`);
$.log(`账号[${this.index}]【${this.nickName}】 余额: ${this.banlance} 金币: ${this.point}`);
return true;
} else {
$.log(`获取用户信息失败: ${res.message}`);
return false;
}
}
async taskList() {
const options = {
'method': 'GET',
'url': 'https://api.quzanmi.com/api/ad/android/list',
'headers': {
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Origin': 'http://anh5.quzanmi.com',
'Pragma': 'no-cache',
'Referer': 'http://anh5.quzanmi.com/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'cross-site',
'User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950',
'sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?1',
'sec-ch-ua-platform': '"Android"',
'x-qzm-aid': `|${this.oaid}|${this.androidId}`,
'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1',
'x-qzm-device': 'android',
'x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),
'x-qzm-token': this.ck,
}
};
const res = await $.request(options);
if (res.code === 2000) {
const list = res.data.filter(item => item.source.includes("videoad"));
// console.log(list)
return list
} else {
$.log(`账号[${this.index}]【${this.nickName}】 获取任务列表 ${res.msg}`);
return false;
}
}
async access() {
const options = {
'method': 'POST',
'url': 'https://api.aibianxian.net/igame/api/v1.0/cplApi/access',
'headers': {
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Origin': 'http://anh5.quzanmi.com',
'Pragma': 'no-cache',
'Referer': 'http://anh5.quzanmi.com/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'cross-site',
'User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950',
'sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?1',
'sec-ch-ua-platform': '"Android"',
'x-qzm-aid': `|${this.oaid}|${this.androidId}`,
'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1',
'x-qzm-device': 'android',
'x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),
'x-qzm-token': this.ck,
'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryZnyXeBEEvBYSL7mL'
},
formData: {
'app_key': '142793900',
'device': 'android',
'device_info': this.oaid,
'target_id': this.id
}
};
const res = await $.request(options);
// console.log(res)
if (res.code == 200) {
this.token = res.data.token;
// console.log(this.token)
return true
} else {
$.log(`账号[${this.index}]【${this.nickName}】 刷新令牌 ${res.msg}`);
return false;
}
}
randomEcpm(min, max) {
// 生成一个介于min和max之间的随机整数
const randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
// 将随机数转换为字符串
return randomNumber.toString();
}
async reward(source) {
const options = {
url: `https://api.quzanmi.com/api/ad/android/reward`,
method: 'POST',
headers: {
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Origin': 'http://anh5.quzanmi.com',
'Pragma': 'no-cache',
'Referer': 'http://anh5.quzanmi.com/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'cross-site',
'Content-Type': 'application/json;charset=UTF-8',
'User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950',
'sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?1',
'sec-ch-ua-platform': '"Android"',
'x-qzm-aid': `|${this.oaid}|${this.androidId}`,
'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1',
'x-qzm-device': 'android',
'x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),
'x-qzm-token': this.ck,
},
body: JSON.stringify({"source": source})
}
const res = await $.request(options);
if (res.code === 2000) {
return true
} else {
$.log(`账号[${this.index}]【${this.nickName}】 领取奖励 ${res.msg}`);
return false;
}
}
async ecpm() {
const options = {
url: `https://api.quzanmi.com/api/ad/app/ecpm`,
method: 'POST',
headers: {
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Origin': 'http://anh5.quzanmi.com',
'Pragma': 'no-cache',
'Referer': 'http://anh5.quzanmi.com/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'cross-site',
'Content-Type': 'application/json;charset=UTF-8',
'User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950',
'sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?1',
'sec-ch-ua-platform': '"Android"',
'x-qzm-aid': `|${this.oaid}|${this.androidId}`,
'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1',
'x-qzm-device': 'android',
'x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),
'x-qzm-token': this.ck,
},
body: JSON.stringify({"ecpm": this.randomEcpm(100000,800000)+".0", "source": "android", "kind": "rewardAd", "rit_id": "1"+this.randomStringNum(8)})
}
const res = await $.request(options);
if (res.code === 2000) {
return true
} else {
return false;
}
}
async trade(point){
const options = {
url: 'https://api.quzanmi.com/api/user/point/trade',
method: 'POST',
headers: {
'Accept': 'application/json, text/plain, */*',
'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'Origin': 'http://anh5.quzanmi.com',
'Pragma': 'no-cache',
'Referer': 'http://anh5.quzanmi.com/',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'cross-site',
'User-Agent': 'Mozilla/5.0 (Linux; Android 14; 22081212C Build/UKQ1.230917.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/125.0.6422.3 Mobile Safari/537.36 AgentWeb/5.0.8 UCBrowser/11.6.4.950',
'sec-ch-ua': '"Android WebView";v="125", "Chromium";v="125", "Not.A/Brand";v="24"',
'sec-ch-ua-mobile': '?1',
'sec-ch-ua-platform': '"Android"',
'x-qzm-aid': `|${this.oaid}|${this.androidId}`,
'x-qzm-bundle': 'com.zhangwen.quzanmi|Redmi|14|1.0.1',
'x-qzm-device': 'android',
'x-qzm-time': parseInt((Date.now() / 1000).toString()).toString(),
'x-qzm-token': this.ck,
},
body: JSON.stringify({
"point": Math.floor(point / 1000) * 1000
})
}
// console.log(options)
const res = await $.request(options);
// console.log(res)
if (res.code === 2000) {
$.log(`账号[${this.index}]【${this.nickName}】 兑换金币成功`);
return true
} else {
$.log(`账号[${this.index}]【${this.nickName}】 兑换金币 ${res.msg}`);
return false;
}
}
};
(async () => {
const qzm = [];
for (const index in cookieArr) {
qzm.push(new QZM(cookieArr[index], index));
}
for (const qzmElement of qzm) {
try {
await qzmElement.main();
} catch (e) {
console.log(e)
}
}
})();
function ENV(name, envNames) {
const request = require("request");
const cryptoJS = require("crypto-js");
return new class {
constructor(name, envNames = []) {
this.name = name;
this.envNames = envNames;
this.startTime = Date.now();
this.logs = [];
if (this.envNames.length > 0) {
for (const envName of envNames) {
this[envName] = process.env[envName];
}
}
this.log(`🔔${this.name},开始!`)
}
log(...args) {
args.length > 0 && (this.logs = [...this.logs, ...args])
console.log(...args)
}
md5(str) {
return cryptoJS.MD5(str).toString()
}
sha256(str) {
return cryptoJS.SHA256(str).toString()
}
aesCBCEncrypt(data, key, iv) {
const n = cryptoJS.enc.Hex.parse(key);
const r = cryptoJS.enc.Hex.parse(iv);
const o = cryptoJS.AES.encrypt(data, n, {
iv: r,
mode: cryptoJS.mode.CBC,
padding: cryptoJS.pad.Pkcs7
});
return cryptoJS.enc.Base64.stringify(o.ciphertext);
}
aesCBCDecrypt(data, key, iv) {
const n = cryptoJS.enc.Hex.parse(key);
const r = cryptoJS.enc.Hex.parse(iv);
const o = cryptoJS.AES.decrypt(data, n, {
iv: r,
mode: cryptoJS.mode.CBC,
padding: cryptoJS.pad.Pkcs7
});
return o.toString(cryptoJS.enc.Utf8);
}
request(options) {
options.gzip = true;
return new Promise((resolve, reject) => {
request(options, (error, response, body) => {
if (error) {
resolve(error)
}
try {
const objBody = JSON.parse(body);
resolve(objBody);
} catch (e) {
resolve(body)
}
})
})
}
wait(time) {
return new Promise((resolve) => setTimeout(resolve, time));
}
}(name, envNames)
}