-
Notifications
You must be signed in to change notification settings - Fork 74
/
dkd_coin.js
628 lines (573 loc) · 23.4 KB
/
dkd_coin.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
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
/*
软件名称:多看点 商店搜索下载
更新时间:2021-02-01 @肥皂
脚本说明:多看点自动任务
目前包含签到,开宝箱,开双倍宝箱
看广告,任务列表奖励领取,自动提现
自动抽奖
能力有限,自动刷小视频暂时无法完成
本脚本以学习为主!
建议通过HttpCanary抓取Cookie,搜索页面地址http://dkd-api.dysdk.com/user/index
TG电报群: https://t.me/hahaha8028
2021.02.01 加入自动提现功能
获取方式,进入提现页面,选择需要自动提现的面额点击提现获取
2021.02.04 修复转盘抽奖提示刷新的问题,加入赚钱抽奖自动刷新并显示抽奖剩余次数,加入观看十分钟视频奖励领取
2021.02.07 任务加入小说时段奖励领取
2021.02.08 修复小说时段奖励倒计时问题
多看点自动任务
*/
const exec = require('child_process').execSync
const fs = require('fs')
const got = require('got')
const axios = require('axios')
const path = require('path')
const cktouch = require('tough-cookie')
const $ = new Env('多看点');
//let dkdurl = $.getdata('dkdurl')
//let dkdhd = dkdhd
//let dkdbody = $.getdata('dkdbody')
//let dkdtxurl = $.getdata('dkdtxurl')
//let dkdtxhd = $.getdata('dkdtxhd')
//let dkdtxbody = $.getdata('dkdtxbody')
const dkdurl = process.env.dkdurl;
const dkdhd = process.env.dkdhd;
const dkdbody = process.env.dkdbody;
const sckey = process.env.sckey;
const tx ={"money":0.5,"type":2,"withdraw_card":null,"program":8,"is_special":1};
let dkdtxurl = $.getdata('dkdtxurl')
let dkdtxhd = $.getdata('dkdtxhd')
let dkdtxbody = $.getdata('dkdtxbody')
!(async () => {
if (typeof $request !== "undefined") {
await dkdck()
await dkdtxck()
} else {
await dkdqd()
}
})()
.catch((e) => $.logErr(e))
.finally(() => $.done())
//多看点数据获取
function dkdck() {
if ($request.url.indexOf("index") > -1) {
$.setdata(JSON.stringify($request.url),'dkdurl')
$.log(dkdurl)
$.setdata(JSON.stringify($request.headers),'dkdhd')
$.log(dkdhd)
$.setdata($request.body,'dkdbody')
$.log(dkdbody)
$.msg($.name,"","多看点headers获取成功!")
$.msg($.name,"","多看点body获取成功!")
}
}
//多看点提现ck
function dkdtxck() {
if ($request.url.indexOf("withdraw_do?") > -1) {
$.setdata(JSON.stringify($request.url),'dkdtxurl')
$.log(dkdtxurl)
$.setdata(JSON.stringify($request.headers),'dkdtxhd')
$.log(dkdtxhd)
$.setdata($request.body,'dkdtxbody')
$.log(dkdtxbody)
$.msg($.name,"","多看点提现数据获取成功!")
}
}
//多看点广告视频
function dkdgg(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/task/get_ad_award',
headers : JSON.parse(dkdhd),
body : 'adType=2&' + dkdbody+'&type=2',}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('广告视频回执:成功🌝 '+result.data.award)
}
if(result.status_code == 10020){
console.log('广告视频回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
//多看点视频宝箱
function dkdbx(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/red/box_award',
headers : JSON.parse(dkdhd),
body : dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('视频宝箱回执:成功🌝 '+result.data.award)
}
if(result.status_code == 10020){
console.log('视频宝箱回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
/*
function dkdyq(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/inviter/bind',
headers : JSON.parse(dkdhd),
body : 'code=3209301&' + dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('视频宝箱回执:成功🌝 '+result.data.award)
}
if(result.status_code == 10020){
console.log('视频宝箱回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
*/
//多看点视频宝箱翻倍
function dkdbxfb(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/red/box_extra',
headers : JSON.parse(dkdhd),
body : 'adType=2&'+dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('视频宝箱翻倍回执:成功🌝 '+result.data.award)
}
if(result.status_code == 10020){
console.log('视频宝箱翻倍回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
//多看点转盘抽奖
function dkdcj(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/lotto/start',
headers : JSON.parse(dkdhd),
body : 'adType=2&'+dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('转盘抽奖回执:成功🌝 '+result.data.award)
}
if(result.status_code == 10020){
console.log('转盘抽奖回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
//多看点分享
function dkdfx(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/task/get_award',
headers : JSON.parse(dkdhd),
body : 'id=52&'+dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('分享任务回执:成功🌝 '+result.data.award)
}
if(result.status_code == 10020){
console.log('分享任务回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
//多看点小说
function dkdxs(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/task/get_award',
headers : JSON.parse(dkdhd),
body : 'id=51&'+dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('小说任务回执:成功🌝 '+result.data.award)
}
if(result.status_code == 10020){
console.log('小说任务回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
//多看点视频时长
function dkdsc(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/task/get_ad_award',
headers : JSON.parse(dkdhd),
body : 'adType=2&'+dkdbody+'&type=1&overLimit',}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('时长任务回执:成功🌝 '+result.data.award)
}
if(result.status_code == 10020){
console.log('时长任务回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
//多看点刷新转盘
function dkdsxzp(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/lotto/index?'+dkdbody,
headers : JSON.parse(dkdhd),
body : '',}
$.post(url, async (err, resp, data) => {
try {
//$.log(str.replace('headerInfo":"',""))
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('开始刷新转抽奖页面,回执:成功🌝 剩余抽奖次数: '+result.data.times)
}
if(result.status_code == 10020){
console.log('开始刷新抽奖页面,回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
//多看点小说时段奖励
function dkdsdjl(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/video/extra_get',
headers : JSON.parse(dkdhd),
body : dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(str.replace('headerInfo":"',""))
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('开始领取小说时段奖励,回执:成功🌝 '+result.data.award)
}
if(result.status_code == 10020){
console.log('开始领取小说时段奖励,回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
function dkdyq(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/inviter/bind?'+dkdbody+'&code=13209301',
headers : JSON.parse(dkdhd),
body : '',}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
function dkddjs(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/video/extra_time',
headers : JSON.parse(dkdhd),
body : dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
function dkdz(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/comment/video_like?'+dkdbody+'&type=1&video_id=9975',
headers : JSON.parse(dkdhd),
body : '',}
$.post(url, async (err, resp, data) => {
try {
const result = JSON.parse(data)
} catch (e) {
} finally {
resolve()
}
},timeout)
})
}
//多看点提现
function dkdtx(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/money/withdraw_do?'+dkdbody,
headers : JSON.parse(dkdhd),
// body : dkdtxbody,}
body : JSON.parse(tx),}
$.post(url, async (err, resp, data) => {
try {
//$.log(str.replace('headerInfo":"',""))
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('提现回执:成功🌝 '+result.message)
}
if(result.status_code == 10020){
console.log('提现回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
function dkdtx2(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/money/withdraw_do?'+dkdbody,
headers : JSON.parse($.getdata('dkdtxhd')),
body : dkdtxbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(str.replace('headerInfo":"',""))
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('提现回执2:成功🌝 '+result.message)
}
if(result.status_code == 10020){
console.log('提现回执2:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
function server(msg) {
return new Promise(async (resolve) => {
try {
let url = `https://sc.ftqq.com/${sckey}.send`
let res = await axios.post(url, `text=多看点(づ ●─● )づ${msg}&desp=${msg}`)
if (res.data.errmsg == 'success') {
console.log('server酱:发送成功')
} else {
console.log('server酱:发送失败')
console.log(res.data)
}
} catch (err) {
console.log(err);
}
resolve();
});
}
//多看点签到
function dkdqd(timeout = 0) {
return new Promise((resolve) => {
setTimeout( ()=>{
let url = {
url : 'http://dkd-api.dysdk.com/task/sign',
headers : JSON.parse(dkdhd),
body : 'adType=2&' + dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('签到回执:成功🌝 '+result.data.sign_award)
}
if(result.status_code == 10020){
console.log('签到回执:失败🚫 '+result.message)
}
//$.msg($.name,"",'多看点开始🖨')
await dkdgg()
await dkdsc()
await dkdbx()
await dkdbxfb()
await dkdsxzp()
await dkdcj()
await dkdfx()
await dkdxs()
await dkddjs()
await dkdsdjl()
await dkdxx()
await dkdz()
await dkdyq()
await dkdtx()
await AutoRead()
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
})
},timeout)
})
}
function AutoRead() {
return new Promise((resolve, reject) => {
let url = {
url: `http://dkd-api.dysdk.com/android_video/getaward`,
headers:JSON.parse(dkdhd),
body: articlebody
};
$.post(url, async (error, response, data) => {
$.begin=$.begin+1;
let res=$.begin%ReadArr.length
$.setdata(res+"", 'dkdvd_body_index');
let readres = JSON.parse(data);
if (readres.status_code == 200) {
console.log(`\n本次自动刷视频获得${readres.data.award}个金币,30秒后进行下次自动刷视频🌝\n`);
readscore += readres.data.award;
await $.wait(30000);
}
else if (readres.status_code == 200) {
console.log(`\n本次视频获得${readres.data.award}个金币,即将开始下次视频👏🏻\n`)
readscore += readres.data.award;
await $.wait(30000);
}
if (readres.message == '请先领取大额红包再来!') {
console.log(`\n检测到红包,,即将开始领取👏🏻\n`)
await dkdhbsp();
}
if (readres.status_code == 200&&readres.data.award == 0) {
$.msg("","","今日多看点视频收益已满,自动结束运行!")
zz = 1
}
else if (readres.status_code == 10020) {
console.log(`第${$.index}次视频请求失败,回执🚫: `+readres.message+'等待30秒执行下次视频')
await $.wait(30000);
}
resolve()
})
})
}
//多看点红包视频
function dkdhbsp(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/video/red_getaward',
headers : JSON.parse(dkdhd),
body : 'adType=2&' + dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdhd)
const result = JSON.parse(data)
if(result.status_code == 200){
console.log('开始视频红包,回执:成功🌝 '+result.data.award)
readscore += result.data.award;
}
if(result.status_code == 10020){
console.log('开始视频红包,回执:失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
//多看点用户信息
function dkdxx(timeout = 0) {
return new Promise((resolve) => {
let url = {
url : 'http://dkd-api.dysdk.com/user/index',
headers : JSON.parse(dkdhd),
body : dkdbody,}
$.post(url, async (err, resp, data) => {
try {
//$.log(dkdbody)
const result = JSON.parse(data)
if(result.status_code == 200){
$.msg($.name+'运行完毕!',"",'用户信息回执:成功🌝\n'+'用户名: '+result.data.nickname+'\n当前余额:'+result.data.cash+'\n总金币:'+result.data.gold+'\n今日金币:'+result.data.today_gold)
await server($.name+'运行完毕!'+'用户名: '+result.data.nickname+'\n当前余额:'+result.data.cash+'\n总金币:'+result.data.gold+'\n今日金币:'+result.data.today_gold)
}
if(result.status_code == 10020){
$.msg($.name,"",'运行完毕,用户信息获取失败🚫 '+result.message)}
} catch (e) {
//$.logErr(e, resp);
} finally {
resolve()
}
},timeout)
})
}
function timeFormat(time) {
let date;
if (time) {
date = new Date(time)
} else {
date = new Date();
}
return date.getFullYear() + '-' + ((date.getMonth() + 1) >= 10 ? (date.getMonth() + 1) : '0' + (date.getMonth() + 1)) + '-' + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate());
}
function Env(t,s){return new class{constructor(t,s){this.name=t,this.data=null,this.dataFile="box.dat",this.logs=[],this.logSeparator="\n",this.startTime=(new Date).getTime(),Object.assign(this,s),this.log("",`\ud83d\udd14${this.name}, \u5f00\u59cb!`)}isNode(){return"undefined"!=typeof module&&!!module.exports}isQuanX(){return"undefined"!=typeof $task}isSurge(){return"undefined"!=typeof $httpClient&&"undefined"==typeof $loon}isLoon(){return"undefined"!=typeof $loon}getScript(t){return new Promise(s=>{$.get({url:t},(t,e,i)=>s(i))})}runScript(t,s){return new Promise(e=>{let i=this.getdata("@chavy_boxjs_userCfgs.httpapi");i=i?i.replace(/\n/g,"").trim():i;let o=this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout");o=o?1*o:20,o=s&&s.timeout?s.timeout:o;const[h,a]=i.split("@"),r={url:`http://${a}/v1/scripting/evaluate`,body:{script_text:t,mock_type:"cron",timeout:o},headers:{"X-Key":h,Accept:"*/*"}};$.post(r,(t,s,i)=>e(i))}).catch(t=>this.logErr(t))}loaddata(){if(!this.isNode())return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};{const i=e?t:s;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}}}writedata(){if(this.isNode()){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(this.dataFile),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s),o=JSON.stringify(this.data);e?this.fs.writeFileSync(t,o):i?this.fs.writeFileSync(s,o):this.fs.writeFileSync(t,o)}}lodash_get(t,s,e){const i=s.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(const t of i)if(o=Object(o)[t],void 0===o)return e;return o}lodash_set(t,s,e){return Object(t)!==t?t:(Array.isArray(s)||(s=s.toString().match(/[^.[\]]+/g)||[]),s.slice(0,-1).reduce((t,e,i)=>Object(t[e])===t[e]?t[e]:t[e]=Math.abs(s[i+1])>>0==+s[i+1]?[]:{},t)[s[s.length-1]]=e,t)}getdata(t){let s=this.getval(t);if(/^@/.test(t)){const[,e,i]=/^@(.*?)\.(.*?)$/.exec(t),o=e?this.getval(e):"";if(o)try{const t=JSON.parse(o);s=t?this.lodash_get(t,i,""):s}catch(t){s=""}}return s}setdata(t,s){let e=!1;if(/^@/.test(s)){const[,i,o]=/^@(.*?)\.(.*?)$/.exec(s),h=this.getval(i),a=i?"null"===h?null:h||"{}":"{}";try{const s=JSON.parse(a);this.lodash_set(s,o,t),e=this.setval(JSON.stringify(s),i)}catch(s){const h={};this.lodash_set(h,o,t),e=this.setval(JSON.stringify(h),i)}}else e=$.setval(t,s);return e}getval(t){return this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loaddata(),this.data[t]):this.data&&this.data[t]||null}setval(t,s){return this.isSurge()||this.isLoon()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):this.isNode()?(this.data=this.loaddata(),this.data[s]=t,this.writedata(),!0):this.data&&this.data[s]||null}initGotEnv(t){this.got=this.got?this.got:require("got"),this.cktough=this.cktough?this.cktough:require("tough-cookie"),this.ckjar=this.ckjar?this.ckjar:new this.cktough.CookieJar,t&&(t.headers=t.headers?t.headers:{},void 0===t.headers.Cookie&&void 0===t.cookieJar&&(t.cookieJar=this.ckjar))}get(t,s=(()=>{})){t.headers&&(delete t.headers["Content-Type"],delete t.headers["Content-Length"]),this.isSurge()||this.isLoon()?$httpClient.get(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)}):this.isQuanX()?$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)):this.isNode()&&(this.initGotEnv(t),this.got(t).on("redirect",(t,s)=>{try{const e=t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();this.ckjar.setCookieSync(e,null),s.cookieJar=this.ckjar}catch(t){this.logErr(t)}}).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t)))}post(t,s=(()=>{})){if(t.body&&t.headers&&!t.headers["Content-Type"]&&(t.headers["Content-Type"]="application/x-www-form-urlencoded"),delete t.headers["Content-Length"],this.isSurge()||this.isLoon())$httpClient.post(t,(t,e,i)=>{!t&&e&&(e.body=i,e.statusCode=e.status),s(t,e,i)});else if(this.isQuanX())t.method="POST",$task.fetch(t).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t));else if(this.isNode()){this.initGotEnv(t);const{url:e,...i}=t;this.got.post(e,i).then(t=>{const{statusCode:e,statusCode:i,headers:o,body:h}=t;s(null,{status:e,statusCode:i,headers:o,body:h},h)},t=>s(t))}}time(t){let s={"M+":(new Date).getMonth()+1,"d+":(new Date).getDate(),"H+":(new Date).getHours(),"m+":(new Date).getMinutes(),"s+":(new Date).getSeconds(),"q+":Math.floor(((new Date).getMonth()+3)/3),S:(new Date).getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,((new Date).getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in s)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s[e]:("00"+s[e]).substr((""+s[e]).length)));return t}msg(s=t,e="",i="",o){const h=t=>!t||!this.isLoon()&&this.isSurge()?t:"string"==typeof t?this.isLoon()?t:this.isQuanX()?{"open-url":t}:void 0:"object"==typeof t&&(t["open-url"]||t["media-url"])?this.isLoon()?t["open-url"]:this.isQuanX()?t:void 0:void 0;this.isSurge()||this.isLoon()?$notification.post(s,e,i,h(o)):this.isQuanX()&&$notify(s,e,i,h(o)),this.logs.push("","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="),this.logs.push(s),e&&this.logs.push(e),i&&this.logs.push(i)}log(...t){t.length>0?this.logs=[...this.logs,...t]:console.log(this.logs.join(this.logSeparator))}logErr(t,s){const e=!this.isSurge()&&!this.isQuanX()&&!this.isLoon();e?$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t.stack):$.log("",`\u2757\ufe0f${this.name}, \u9519\u8bef!`,t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){const s=(new Date).getTime(),e=(s-this.startTime)/1e3;this.log("",`\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`),this.log(),(this.isSurge()||this.isQuanX()||this.isLoon())&&$done(t)}}(t,s)}