-
Notifications
You must be signed in to change notification settings - Fork 99
/
index.js
3314 lines (3257 loc) · 118 KB
/
index.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
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*************************
京东多合一签到脚本
更新时间: 2020.12.25 17:50 v1.89
有效接口: 40+
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
电报频道: @NobyDa
问题反馈: @NobyDa_bot
如果转载: 请注明出处
*************************
【 JSbox, Node.js 说明 】 :
*************************
开启抓包app后, Safari浏览器登录 https://bean.m.jd.com 点击签到并且出现签到日历后, 返回抓包app搜索关键字 functionId=signBean 复制请求头Cookie填入以下Key处的单引号内即可 */
const [cookie, serverSecret] = process.argv.slice(2);
var Key = cookie; //单引号内自行填写您抓取的Cookie
var DualKey = ''; //如需双账号签到,此处单引号内填写抓取的"账号2"Cookie, 否则请勿填写
var LogDetails = false; //是否开启响应日志, true则开启
var stop = 0; //自定义延迟签到,单位毫秒. 默认分批并发无延迟. 延迟作用于每个签到接口, 如填入延迟则切换顺序签到(耗时较长), VPN重启或越狱用户建议填写1, Surge用户请注意在SurgeUI界面调整脚本超时
var DeleteCookie = false; //是否清除Cookie, true则开启.
var boxdis = true; //是否开启自动禁用, false则关闭. 脚本运行崩溃时(如VPN断连), 下次运行时将自动禁用相关崩溃接口(仅部分接口启用), 崩溃时可能会误禁用正常接口. (该选项仅适用于QX,Surge,Loon)
var ReDis = false; //是否移除所有禁用列表, true则开启. 适用于触发自动禁用后, 需要再次启用接口的情况. (该选项仅适用于QX,Surge,Loon)
var out = 0; //接口超时退出, 用于可能发生的网络不稳定, 0则关闭. 如QX日志出现大量"JS Context timeout"后脚本中断时, 建议填写6000
var $nobyda = nobyda();
async function all() {
merge = {};
switch (stop) {
case 0:
await Promise.all([
JingDongBean(stop), //京东京豆
JDTakeaLook(stop), //京东发现-看一看
JingDongStore(stop), //京东超市
JingDongWebcasts(stop), //京东直播
JingRongBean(stop), //金融简单赚钱
JingRongSteel(stop), //金融钢镚
JingDongTurn(stop), //京东转盘
JDFlashSale(stop), //京东闪购
JDOverseas(stop), //京东国际
JingDongCash(stop), //京东现金红包
JDMagicCube(stop, 2), //京东小魔方
JingDongSubsidy(stop), //京东金贴
JingDongGetCash(stop), //京东领现金
JingDongShake(stop), //京东摇一摇
JDSecKilling(stop), //京东秒杀
JRLuckyLottery(stop), //金融抽奖顶部签到
JingDongBuyCar(stop, '5fc3c1f2e91f46f09ab2b722e10d92bf'), //京东汽车
JingRongDoll(stop, 'JRDoll', '京东金融-签壹', '4D25A6F482'),
JingRongDoll(stop, 'JRTwoDoll', '京东金融-签贰', '3A3E839252'),
JingRongDoll(stop, 'JRThreeDoll', '京东金融-签叁', '69F5EC743C'),
JingRongDoll(stop, 'JRFourDoll', '京东金融-签肆', '30C4F86264'),
JingRongDoll(stop, 'JRFiveDoll', '京东金融-签伍', '1D06AA3B0F'),
]);
await Promise.all([
JDUserSignPre(
stop,
'JDClothing',
'京东商城-服饰',
'4RBT3H9jmgYg1k2kBnHF8NAHm7m8'
), //京东服饰
JDUserSignPre(
stop,
'JDUnderwear',
'京东商城-内衣',
'4PgpL1xqPSW1sVXCJ3xopDbB1f69'
), //京东内衣馆
JDUserSignPre(
stop,
'JDShoes',
'京东商城-鞋靴',
'4RXyb1W4Y986LJW8ToqMK14BdTD'
), //京东鞋靴
JDUserSignPre(
stop,
'JDCalendar',
'京东日历-翻牌',
'36V2Qw59VPNsuLxY84vCFtxFzrFs'
), //京东日历翻牌
JDUserSignPre(
stop,
'JDChild',
'京东商城-童装',
'3Af6mZNcf5m795T8dtDVfDwWVNhJ'
), //京东童装馆
JDUserSignPre(
stop,
'JDBaby',
'京东商城-母婴',
'3BbAVGQPDd6vTyHYjmAutXrKAos6'
), //京东母婴馆
JDUserSignPre(
stop,
'JD3C',
'京东商城-数码',
'4SWjnZSCTHPYjE5T7j35rxxuMTb6'
), //京东数码电器馆
JDUserSignPre(
stop,
'JDSubsidy',
'京东晚市-补贴',
'xK148m4kWj5hBcTPuJUNNXH3AkJ'
), //京东晚市补贴金
JDUserSignPre(
stop,
'JDDrug',
'京东商城-医药',
'3tqTG5sF1xCUyC6vgEF5CLCxGn7w'
), //京东医药馆
JDUserSignPre(
stop,
'JDWomen',
'京东商城-女装',
'DpSh7ma8JV7QAxSE2gJNro8Q2h9'
), //京东女装馆
JDUserSignPre(
stop,
'JDFineWine',
'京东商城-酒饮',
'zGwAUzL3pVGjptBBGeYfpKjYdtX'
), //京东酒饮馆
JDUserSignPre(
stop,
'JDBook',
'京东商城-图书',
'3SC6rw5iBg66qrXPGmZMqFDwcyXi'
), //京东图书
JingRongDoll(stop, 'JTDouble', '京东金贴-双签', '1DF13833F7'), //京东金融 金贴双签
JingRongDoll(
stop,
'XJDouble',
'金融现金-双签',
'F68B2C3E71',
'',
'',
'',
'xianjin'
), //京东金融 现金双签
]);
await Promise.all([
JDUserSignPre(
stop,
'JDSuitcase',
'京东商城-箱包',
'ZrH7gGAcEkY2gH8wXqyAPoQgk6t'
), //京东箱包馆
JDUserSignPre(
stop,
'JDSchool',
'京东商城-校园',
'4812pn2PAcUyfNdWr7Cvpww5MCyW'
), //京东校园
JDUserSignPre(
stop,
'JDHealth',
'京东商城-健康',
'w2oeK5yLdHqHvwef7SMMy4PL8LF'
), //京东健康
JDUserSignPre(
stop,
'JDPet',
'京东商城-宠物',
'37ta5sh5ocrMZF3Fz5UMJbTsL42'
), //京东宠物馆
JDUserSignPre(
stop,
'JDShand',
'京东拍拍-二手',
'3S28janPLYmtFxypu37AYAGgivfp'
), //京东拍拍二手
JDUserSignPre(
stop,
'JDClean',
'京东商城-清洁',
'2Tjm6ay1ZbZ3v7UbriTj6kHy9dn6'
), //京东清洁馆
JDUserSignPre(
stop,
'JDCare',
'京东商城-个护',
'NJ1kd1PJWhwvhtim73VPsD1HwY3'
), //京东个人护理馆
JDUserSignPre(
stop,
'JDJewels',
'京东商城-珠宝',
'zHUHpTHNTaztSRfNBFNVZscyFZU'
), //京东珠宝馆
JDUserSignPre(
stop,
'JDClocks',
'京东商城-钟表',
'2BcJPCVVzMEtMUynXkPscCSsx68W'
), //京东钟表馆
JDUserSignPre(
stop,
'JDMakeup',
'京东商城-美妆',
'2smCxzLNuam5L14zNJHYu43ovbAP'
), //京东美妆馆
JDUserSignPre(
stop,
'JDVege',
'京东商城-菜场',
'Wcu2LVCFMkBP3HraRvb7pgSpt64'
), //京东菜场
]);
await JingDongSpeedUp(stop); //京东天天加速
await JingRongDoll(
stop,
'JDDouble',
'金融京豆-双签',
'F68B2C3E71',
'',
'',
'',
'jingdou'
); //京东金融 京豆双签
break;
default:
await JingDongBean(stop); //京东京豆
await JDTakeaLook(stop); //京东发现-看一看
await JingDongStore(stop); //京东超市
await JingDongWebcasts(stop); //京东直播
await JingRongBean(stop); //金融简单赚钱
await JingRongSteel(stop); //金融钢镚
await JingDongTurn(stop); //京东转盘
await JDFlashSale(stop); //京东闪购
await JDOverseas(stop); //京东国际
await JingDongCash(stop); //京东现金红包
await JDMagicCube(stop, 2); //京东小魔方
await JingDongGetCash(stop); //京东领现金
await JingDongSubsidy(stop); //京东金贴
await JingDongShake(stop); //京东摇一摇
await JDSecKilling(stop); //京东秒杀
await JRLuckyLottery(stop); //金融抽奖顶部签到
await JingDongBuyCar(stop, '5fc3c1f2e91f46f09ab2b722e10d92bf'); //京东汽车
await JingRongDoll(stop, 'JRTwoDoll', '京东金融-签贰', '3A3E839252');
await JingRongDoll(stop, 'JRThreeDoll', '京东金融-签叁', '69F5EC743C');
await JingRongDoll(stop, 'JRFourDoll', '京东金融-签肆', '30C4F86264');
await JingRongDoll(stop, 'JRFiveDoll', '京东金融-签伍', '1D06AA3B0F');
await JingRongDoll(stop, 'JRDoll', '京东金融-签壹', '4D25A6F482');
await JingRongDoll(
stop,
'XJDouble',
'金融现金-双签',
'F68B2C3E71',
'',
'',
'',
'xianjin'
); //京东金融 现金双签
await JingRongDoll(stop, 'JTDouble', '京东金贴-双签', '1DF13833F7'); //京东金融 金贴双签
await JDUserSignPre(
stop,
'JDUnderwear',
'京东商城-内衣',
'4PgpL1xqPSW1sVXCJ3xopDbB1f69'
); //京东内衣馆
await JDUserSignPre(
stop,
'JDSuitcase',
'京东商城-箱包',
'ZrH7gGAcEkY2gH8wXqyAPoQgk6t'
); //京东箱包馆
await JDUserSignPre(
stop,
'JDClothing',
'京东商城-服饰',
'4RBT3H9jmgYg1k2kBnHF8NAHm7m8'
); //京东服饰
await JDUserSignPre(
stop,
'JDSchool',
'京东商城-校园',
'4812pn2PAcUyfNdWr7Cvpww5MCyW'
); //京东校园
await JDUserSignPre(
stop,
'JDHealth',
'京东商城-健康',
'w2oeK5yLdHqHvwef7SMMy4PL8LF'
); //京东健康
await JDUserSignPre(
stop,
'JDShoes',
'京东商城-鞋靴',
'4RXyb1W4Y986LJW8ToqMK14BdTD'
); //京东鞋靴
await JDUserSignPre(
stop,
'JDCalendar',
'京东日历-翻牌',
'36V2Qw59VPNsuLxY84vCFtxFzrFs'
); //京东日历翻牌
await JDUserSignPre(
stop,
'JDChild',
'京东商城-童装',
'3Af6mZNcf5m795T8dtDVfDwWVNhJ'
); //京东童装馆
await JDUserSignPre(
stop,
'JDBaby',
'京东商城-母婴',
'3BbAVGQPDd6vTyHYjmAutXrKAos6'
); //京东母婴馆
await JDUserSignPre(
stop,
'JD3C',
'京东商城-数码',
'4SWjnZSCTHPYjE5T7j35rxxuMTb6'
); //京东数码电器馆
await JDUserSignPre(
stop,
'JDSubsidy',
'京东晚市-补贴',
'xK148m4kWj5hBcTPuJUNNXH3AkJ'
); //京东晚市补贴金
await JDUserSignPre(
stop,
'JDClocks',
'京东商城-钟表',
'2BcJPCVVzMEtMUynXkPscCSsx68W'
); //京东钟表馆
await JDUserSignPre(
stop,
'JDDrug',
'京东商城-医药',
'3tqTG5sF1xCUyC6vgEF5CLCxGn7w'
); //京东医药馆
await JDUserSignPre(
stop,
'JDWomen',
'京东商城-女装',
'DpSh7ma8JV7QAxSE2gJNro8Q2h9'
); //京东女装馆
await JDUserSignPre(
stop,
'JDPet',
'京东商城-宠物',
'37ta5sh5ocrMZF3Fz5UMJbTsL42'
); //京东宠物馆
await JDUserSignPre(
stop,
'JDBook',
'京东商城-图书',
'3SC6rw5iBg66qrXPGmZMqFDwcyXi'
); //京东图书
await JDUserSignPre(
stop,
'JDShand',
'京东拍拍-二手',
'3S28janPLYmtFxypu37AYAGgivfp'
); //京东拍拍二手
await JDUserSignPre(
stop,
'JDMakeup',
'京东商城-美妆',
'2smCxzLNuam5L14zNJHYu43ovbAP'
); //京东美妆馆
await JDUserSignPre(
stop,
'JDFineWine',
'京东商城-酒饮',
'zGwAUzL3pVGjptBBGeYfpKjYdtX'
); //京东酒饮馆
await JDUserSignPre(
stop,
'JDVege',
'京东商城-菜场',
'Wcu2LVCFMkBP3HraRvb7pgSpt64'
); //京东菜场
await JDUserSignPre(
stop,
'JDClean',
'京东商城-清洁',
'2Tjm6ay1ZbZ3v7UbriTj6kHy9dn6'
); //京东清洁馆
await JDUserSignPre(
stop,
'JDCare',
'京东商城-个护',
'NJ1kd1PJWhwvhtim73VPsD1HwY3'
); //京东个人护理馆
await JDUserSignPre(
stop,
'JDJewels',
'京东商城-珠宝',
'zHUHpTHNTaztSRfNBFNVZscyFZU'
); //京东珠宝馆
await JingRongDoll(
stop,
'JDDouble',
'金融京豆-双签',
'F68B2C3E71',
'',
'',
'',
'jingdou'
); //京东金融 京豆双签
await JingDongSpeedUp(stop); //京东天天加速
break;
}
await Promise.all([
TotalSteel(), //总钢镚查询
TotalCash(), //总红包查询
TotalBean(), //总京豆查询
TotalSubsidy(), //总金贴查询
TotalMoney(), //总现金查询
]);
await notify(); //通知模块
}
function notify() {
return new Promise((resolve) => {
try {
var bean = 0;
var steel = 0;
var cash = 0;
var money = 0;
var subsidy = 0;
var success = 0;
var fail = 0;
var err = 0;
var notify = '';
for (var i in merge) {
bean += merge[i].bean ? Number(merge[i].bean) : 0;
steel += merge[i].steel ? Number(merge[i].steel) : 0;
cash += merge[i].Cash ? Number(merge[i].Cash) : 0;
money += merge[i].Money ? Number(merge[i].Money) : 0;
subsidy += merge[i].subsidy ? Number(merge[i].subsidy) : 0;
success += merge[i].success ? Number(merge[i].success) : 0;
fail += merge[i].fail ? Number(merge[i].fail) : 0;
err += merge[i].error ? Number(merge[i].error) : 0;
notify += merge[i].notify ? '\n' + merge[i].notify : '';
}
var Cash =
merge.TotalCash && merge.TotalCash.TCash
? `${merge.TotalCash.TCash}红包`
: '';
var Steel =
merge.TotalSteel && merge.TotalSteel.TSteel
? `${merge.TotalSteel.TSteel}钢镚`
: ``;
var beans =
merge.TotalBean && merge.TotalBean.Qbear
? `${merge.TotalBean.Qbear}京豆${Steel ? `, ` : ``}`
: '';
var Money =
merge.TotalMoney && merge.TotalMoney.TMoney
? `${merge.TotalMoney.TMoney}现金${Cash ? `, ` : ``}`
: '';
var Subsidy =
merge.TotalSubsidy && merge.TotalSubsidy.TSubsidy
? `${merge.TotalSubsidy.TSubsidy}金贴${Money || Cash ? ', ' : ''}`
: '';
var Tbean = bean ? `${bean.toFixed(0)}京豆${steel ? ', ' : ''}` : '';
var TSteel = steel ? `${steel.toFixed(2)}钢镚` : '';
var TCash = cash
? `${cash.toFixed(2)}红包${subsidy || money ? ', ' : ''}`
: '';
var TSubsidy = subsidy
? `${subsidy.toFixed(2)}金贴${money ? ', ' : ''}`
: '';
var TMoney = money ? `${money.toFixed(2)}现金` : '';
var Ts = success ? `成功${success}个${fail || err ? `, ` : ``}` : ``;
var Tf = fail ? `失败${fail}个${err ? `, ` : ``}` : ``;
var Te = err ? `错误${err}个` : ``;
var one = `【签到概览】: ${Ts + Tf + Te}${
Ts || Tf || Te ? `\n` : `获取失败\n`
}`;
var two = Tbean || TSteel ? `【签到奖励】: ${Tbean + TSteel}\n` : ``;
var three =
TCash || TSubsidy || TMoney
? `【其他奖励】: ${TCash + TSubsidy + TMoney}\n`
: ``;
var four = `【账号总计】: ${beans + Steel}${
beans || Steel ? `\n` : `获取失败\n`
}`;
var five = `【其他总计】: ${Subsidy + Money + Cash}${
Subsidy || Money || Cash ? `\n` : `获取失败\n`
}`;
var DName =
merge.TotalBean && merge.TotalBean.nickname
? merge.TotalBean.nickname
: '获取失败';
var Name = add
? DualAccount
? `【签到号一】: ${DName}\n`
: `【签到号二】: ${DName}\n`
: '';
const disables = $nobyda.read('JD_DailyBonusDisables');
const amount = disables ? disables.split(',').length : 0;
const disa =
!notify || amount
? `【温馨提示】: 检测到${
$nobyda.disable ? `上次执行意外崩溃, ` : ``
}已禁用${
notify ? `${amount}个` : `所有`
}接口, 如需开启请前往BoxJs或查看脚本内第99行注释.\n`
: ``;
$nobyda.notify(
'',
'',
Name + one + two + three + four + five + disa + notify,
{
'media-url':
$nobyda.headUrl ||
'https://cdn.jsdelivr.net/gh/Orz-3/task@master/jd.png',
}
);
$nobyda.headUrl = null;
if ($nobyda.isJSBox) {
if (add && DualAccount) {
Shortcut = Name + one + two + three + '\n';
} else if (!add && DualAccount) {
$intents.finish(Name + one + two + three + four + five + notify);
} else if (typeof Shortcut != 'undefined') {
$intents.finish(Shortcut + Name + one + two + three);
}
}
if (DualAccount) {
double();
} else {
$nobyda.time();
$nobyda.done();
}
} catch (eor) {
$nobyda.notify(
'通知模块 ' + eor.name + '‼️',
JSON.stringify(eor),
eor.message
);
} finally {
resolve();
}
});
}
function ReadCookie() {
DualAccount = true;
const EnvInfo = $nobyda.isJSBox ? 'JD_Cookie' : 'CookieJD';
const EnvInfo2 = $nobyda.isJSBox ? 'JD_Cookie2' : 'CookieJD2';
if (DeleteCookie) {
if ($nobyda.read(EnvInfo) || $nobyda.read(EnvInfo2)) {
$nobyda.write('', EnvInfo);
$nobyda.write('', EnvInfo2);
$nobyda.notify(
'京东Cookie清除成功 !',
'',
'请手动关闭脚本内"DeleteCookie"选项'
);
$nobyda.done();
return;
}
$nobyda.notify('脚本终止', '', '未关闭脚本内"DeleteCookie"选项 ‼️');
$nobyda.done();
return;
} else if ($nobyda.isRequest) {
GetCookie();
return;
}
if (Key || $nobyda.read(EnvInfo)) {
if ($nobyda.isJSBox || $nobyda.isNode) {
if (Key) $nobyda.write(Key, EnvInfo);
if (DualKey) $nobyda.write(DualKey, EnvInfo2);
}
add = DualKey || $nobyda.read(EnvInfo2) ? true : false;
KEY = Key ? Key : $nobyda.read(EnvInfo);
out = parseInt($nobyda.read('JD_DailyBonusTimeOut')) || out;
stop = parseInt($nobyda.read('JD_DailyBonusDelay')) || stop;
boxdis =
$nobyda.read('JD_Crash_disable') === 'false' ||
$nobyda.isNode ||
$nobyda.isJSBox
? false
: boxdis;
LogDetails = $nobyda.read('JD_DailyBonusLog') === 'true' || LogDetails;
ReDis = ReDis ? $nobyda.write('', 'JD_DailyBonusDisables') : '';
all();
} else {
$nobyda.notify('京东签到', '', '脚本终止, 未获取Cookie ‼️');
$nobyda.done();
}
}
function double() {
add = true;
DualAccount = false;
if (DualKey || $nobyda.read($nobyda.isJSBox ? 'JD_Cookie2' : 'CookieJD2')) {
KEY = DualKey
? DualKey
: $nobyda.read($nobyda.isJSBox ? 'JD_Cookie2' : 'CookieJD2');
all();
} else {
$nobyda.time();
$nobyda.done();
}
}
function JingDongBean(s) {
merge.JDBean = {};
return new Promise((resolve) => {
if (disable('JDBean')) return resolve();
setTimeout(() => {
const JDBUrl = {
url: 'https://api.m.jd.com/client.action',
headers: {
Cookie: KEY,
},
body: 'functionId=signBeanIndex&appid=ld',
};
$nobyda.post(JDBUrl, function (error, response, data) {
try {
if (error) {
throw new Error(error);
} else {
const cc = JSON.parse(data);
const Details = LogDetails ? 'response:\n' + data : '';
if (cc.code == 3) {
console.log('\n' + '京东商城-京豆Cookie失效 ' + Details);
merge.JDBean.notify = '京东商城-京豆: 失败, 原因: Cookie失效‼️';
merge.JDBean.fail = 1;
} else if (data.match(/跳转至拼图/)) {
merge.JDBean.notify = '京东商城-京豆: 失败, 需要拼图验证 ⚠️';
merge.JDBean.fail = 1;
} else if (data.match(/\"status\":\"?1\"?/)) {
console.log('\n' + '京东商城-京豆签到成功 ' + Details);
if (data.match(/dailyAward/)) {
merge.JDBean.notify =
'京东商城-京豆: 成功, 明细: ' +
cc.data.dailyAward.beanAward.beanCount +
'京豆 🐶';
merge.JDBean.bean = cc.data.dailyAward.beanAward.beanCount;
} else if (data.match(/continuityAward/)) {
merge.JDBean.notify =
'京东商城-京豆: 成功, 明细: ' +
cc.data.continuityAward.beanAward.beanCount +
'京豆 🐶';
merge.JDBean.bean = cc.data.continuityAward.beanAward.beanCount;
} else if (data.match(/新人签到/)) {
const quantity = data.match(/beanCount\":\"(\d+)\".+今天/);
merge.JDBean.bean = quantity ? quantity[1] : 0;
merge.JDBean.notify =
'京东商城-京豆: 成功, 明细: ' +
(quantity ? quantity[1] : '无') +
'京豆 🐶';
} else {
merge.JDBean.notify = '京东商城-京豆: 成功, 明细: 无京豆 🐶';
}
merge.JDBean.success = 1;
} else {
merge.JDBean.fail = 1;
console.log('\n' + '京东商城-京豆签到失败 ' + Details);
if (data.match(/(已签到|新人签到)/)) {
merge.JDBean.notify = '京东商城-京豆: 失败, 原因: 已签过 ⚠️';
} else if (data.match(/人数较多|S101/)) {
merge.JDBean.notify = '京东商城-京豆: 失败, 签到人数较多 ⚠️';
} else {
merge.JDBean.notify = '京东商城-京豆: 失败, 原因: 未知 ⚠️';
}
}
}
} catch (eor) {
$nobyda.AnError('京东商城-京豆', 'JDBean', eor, response, data);
} finally {
resolve();
}
});
}, s);
if (out) setTimeout(resolve, out + s);
});
}
function JingDongTurn(s) {
(merge.JDTurn = {}),
(merge.JDTurn.notify = ''),
(merge.JDTurn.success = 0),
(merge.JDTurn.bean = 0);
return new Promise((resolve, reject) => {
if (disable('JDTurn')) return reject();
const JDTUrl = {
url:
'https://api.m.jd.com/client.action?functionId=wheelSurfIndex&body=%7B%22actId%22%3A%22jgpqtzjhvaoym%22%2C%22appSource%22%3A%22jdhome%22%7D&appid=ld',
headers: {
Cookie: KEY,
},
};
$nobyda.get(JDTUrl, async function (error, response, data) {
try {
if (error) {
throw new Error(error);
} else {
const cc = JSON.parse(data).data.lotteryCode;
const Details = LogDetails ? 'response:\n' + data : '';
if (cc) {
console.log('\n' + '京东商城-转盘查询成功 ' + Details);
return resolve(cc);
} else {
merge.JDTurn.notify = '京东商城-转盘: 失败, 原因: 查询错误 ⚠️';
merge.JDTurn.fail = 1;
console.log('\n' + '京东商城-转盘查询失败 ' + Details);
}
}
} catch (eor) {
$nobyda.AnError('京东转盘-查询', 'JDTurn', eor, response, data);
} finally {
reject();
}
});
if (out) setTimeout(reject, out + s);
}).then(
(data) => {
return JingDongTurnSign(s, data);
},
() => {}
);
}
function JingDongTurnSign(s, code) {
return new Promise((resolve) => {
setTimeout(() => {
const JDTUrl = {
url: `https://api.m.jd.com/client.action?functionId=lotteryDraw&body=%7B%22actId%22%3A%22jgpqtzjhvaoym%22%2C%22appSource%22%3A%22jdhome%22%2C%22lotteryCode%22%3A%22${code}%22%7D&appid=ld`,
headers: {
Cookie: KEY,
},
};
$nobyda.get(JDTUrl, async function (error, response, data) {
try {
if (error) {
throw new Error(error);
} else {
const cc = JSON.parse(data);
const Details = LogDetails ? 'response:\n' + data : '';
const also = merge.JDTurn.notify ? true : false;
if (cc.code == 3) {
console.log('\n' + '京东转盘Cookie失效 ' + Details);
merge.JDTurn.notify = '京东商城-转盘: 失败, 原因: Cookie失效‼️';
merge.JDTurn.fail = 1;
} else if (data.match(/(\"T216\"|活动结束)/)) {
merge.JDTurn.notify = '京东商城-转盘: 失败, 原因: 活动结束 ⚠️';
merge.JDTurn.fail = 1;
} else if (data.match(/(京豆|\"910582\")/)) {
console.log('\n' + '京东商城-转盘签到成功 ' + Details);
merge.JDTurn.bean += Number(cc.data.prizeSendNumber) || 0;
merge.JDTurn.notify += `${also ? `\n` : ``}京东商城-转盘: ${
also ? `多次` : `成功`
}, 明细: ${cc.data.prizeSendNumber || `无`}京豆 🐶`;
merge.JDTurn.success += 1;
if (cc.data.chances != '0') {
await JingDongTurnSign(2000, code);
}
} else if (data.match(/未中奖/)) {
merge.JDTurn.notify += `${also ? `\n` : ``}京东商城-转盘: ${
also ? `多次` : `成功`
}, 状态: 未中奖 🐶`;
merge.JDTurn.success += 1;
if (cc.data.chances != '0') {
await JingDongTurnSign(2000, code);
}
} else {
console.log('\n' + '京东商城-转盘签到失败 ' + Details);
merge.JDTurn.fail = 1;
if (data.match(/(T215|次数为0)/)) {
merge.JDTurn.notify = '京东商城-转盘: 失败, 原因: 已转过 ⚠️';
} else if (data.match(/(T210|密码)/)) {
merge.JDTurn.notify =
'京东商城-转盘: 失败, 原因: 无支付密码 ⚠️';
} else {
merge.JDTurn.notify += `${
also ? `\n` : ``
}京东商城-转盘: 失败, 原因: 未知 ⚠️${also ? ` (多次)` : ``}`;
}
}
}
} catch (eor) {
$nobyda.AnError('京东商城-转盘', 'JDTurn', eor, response, data);
} finally {
resolve();
}
});
}, s);
if (out) setTimeout(resolve, out + s);
});
}
function JingRongBean(s) {
merge.JRBean = {};
return new Promise((resolve) => {
if (disable('JRBean')) return resolve();
setTimeout(() => {
const login = {
url: 'https://ms.jr.jd.com/gw/generic/zc/h5/m/queryOpenScreenReward',
headers: {
Cookie: KEY,
},
body:
'reqData=%7B%22channelCode%22%3A%22ZHUANQIAN%22%2C%22clientType%22%3A%22sms%22%2C%22clientVersion%22%3A%2211.0%22%7D',
};
$nobyda.post(login, async function (error, response, data) {
try {
if (error) {
throw new Error(error);
} else {
const Details = LogDetails ? 'response:\n' + data : '';
if (data.match(/\"login\":true/)) {
console.log('\n' + '京东金融-金贴查询成功 ' + Details);
const cc = JSON.parse(data);
if (cc.resultData.data.reward === false) {
await JRBeanCheckin(s, cc.resultData.data.rewardAmount);
} else {
const tp = cc.resultData.data.reward === true;
merge.JRBean.notify = `京东金融-金贴: 失败, 原因: ${
tp ? `已签过` : `未知`
} ⚠️`;
merge.JRBean.fail = 1;
}
} else {
console.log('\n' + '京东金融-金贴查询失败 ' + Details);
const lt = data.match(/\"login\":false/);
merge.JRBean.fail = 1;
merge.JRBean.notify = `京东金融-金贴: 失败, 原因: ${
lt ? `Cookie失效‼️` : `未知 ⚠️`
}`;
}
}
} catch (eor) {
$nobyda.AnError('金融金贴-查询', 'JRBean', eor, response, data);
} finally {
resolve();
}
});
}, s);
if (out) setTimeout(resolve, out + s);
});
}
function JRBeanCheckin(s, amount) {
return new Promise((resolve) => {
setTimeout(() => {
const JRBUrl = {
url: 'https://ms.jr.jd.com/gw/generic/zc/h5/m/openScreenReward',
headers: {
Cookie: KEY,
},
body:
'reqData=%7B%22channelCode%22%3A%22ZHUANQIAN%22%2C%22clientType%22%3A%22sms%22%2C%22clientVersion%22%3A%2211.0%22%7D',
};
$nobyda.post(JRBUrl, function (error, response, data) {
try {
if (error) {
throw new Error(error);
} else {
const Details = LogDetails ? 'response:\n' + data : '';
if (data.match(/\"rewardCode\":\"00000\"/)) {
console.log('\n' + '京东金融-金贴签到成功 ' + Details);
merge.JRBean.subsidy = amount || 0;
merge.JRBean.notify = `京东金融-金贴: 成功, 明细: ${
amount || `无`
}金贴 💰`;
merge.JRBean.success = 1;
} else {
console.log('\n' + '京东金融-金贴签到失败 ' + Details);
merge.JRBean.fail = 1;
if (data.match(/发放失败|70111|10000|60203/)) {
merge.JRBean.notify = '京东金融-金贴: 失败, 原因: 已签过 ⚠️';
} else {
const UnType = data.match(/\"resultCode\":3|请先登录/);
merge.JRBean.notify = `京东金融-金贴: 失败, 原因: ${
UnType ? `Cookie失效‼️` : `未知 ⚠️`
}`;
}
}
}
} catch (eor) {
$nobyda.AnError('京东金融-金贴', 'JRBean', eor, response, data);
} finally {
resolve();
}
});
}, s);
if (out) setTimeout(resolve, out + s);
});
}
function JingRongSteel(s) {
merge.JRSteel = {};
return new Promise((resolve) => {
if (disable('JRSteel')) return resolve();
setTimeout(() => {
const JRSUrl = {
url: 'https://ms.jr.jd.com/gw/generic/hy/h5/m/signIn1',
headers: {
Cookie: KEY,
},
body:
'reqData=%7B%22channelSource%22%3A%22JRAPP6.0%22%2C%22riskDeviceParam%22%3A%22%7B%7D%22%7D',
};
$nobyda.post(JRSUrl, function (error, response, data) {
try {
if (error) throw new Error(error);
const cc = JSON.parse(data);
const Details = LogDetails ? 'response:\n' + data : '';
if (data.match(/\"resBusiCode\":0/)) {
console.log('\n' + '京东金融-钢镚签到成功 ' + Details);
const leng = cc.resultData.resBusiData.actualTotalRewardsValue;
const spare = cc.resultData.resBusiData.baseReward;
merge.JRSteel.steel = leng
? leng > 9
? `0.${leng}`
: `0.0${leng}`
: spare
? spare
: 0;
merge.JRSteel.notify = `京东金融-钢镚: 成功, 明细: ${
merge.JRSteel.steel || `无`
}钢镚 💰`;
merge.JRSteel.success = 1;
} else {
console.log('\n' + '京东金融-钢镚签到失败 ' + Details);
merge.JRSteel.fail = 1;
if (data.match(/已经领取|\"resBusiCode\":15/)) {
merge.JRSteel.notify = '京东金融-钢镚: 失败, 原因: 已签过 ⚠️';
} else if (data.match(/未实名/)) {
merge.JRSteel.notify = '京东金融-钢镚: 失败, 账号未实名 ⚠️';
} else if (data.match(/(\"resultCode\":3|请先登录)/)) {
merge.JRSteel.notify = '京东金融-钢镚: 失败, 原因: Cookie失效‼️';
} else {
merge.JRSteel.notify = '京东金融-钢镚: 失败, 原因: 未知 ⚠️';
}
}
} catch (eor) {
$nobyda.AnError('京东金融-钢镚', 'JRSteel', eor, response, data);
} finally {
resolve();
}
});
}, s);
if (out) setTimeout(resolve, out + s);
});
}
function JingDongShake(s) {
if (!merge.JDShake)
(merge.JDShake = {}),
(merge.JDShake.success = 0),
(merge.JDShake.bean = 0),
(merge.JDShake.notify = '');
return new Promise((resolve) => {
if (disable('JDShake')) return resolve();
setTimeout(() => {
const JDSh = {
url:
'https://api.m.jd.com/client.action?appid=vip_h5&functionId=vvipclub_shaking',
headers: {
Cookie: KEY,
},
};
$nobyda.get(JDSh, async function (error, response, data) {
try {
if (error) {
throw new Error(error);
} else {
const Details = LogDetails ? 'response:\n' + data : '';
const cc = JSON.parse(data);
const also = merge.JDShake.notify ? true : false;
if (data.match(/prize/)) {
console.log('\n' + '京东商城-摇一摇签到成功 ' + Details);
merge.JDShake.success += 1;
if (cc.data.prizeBean) {
merge.JDShake.bean += cc.data.prizeBean.count || 0;
merge.JDShake.notify += `${also ? `\n` : ``}京东商城-摇摇: ${
also ? `多次` : `成功`
}, 明细: ${merge.JDShake.bean || `无`}京豆 🐶`;
} else if (cc.data.prizeCoupon) {
merge.JDShake.notify += `${also ? `\n` : ``}京东商城-摇摇: ${
also ? `多次, ` : ``
}获得满${cc.data.prizeCoupon.quota}减${
cc.data.prizeCoupon.discount
}优惠券→ ${cc.data.prizeCoupon.limitStr}`;
} else {
merge.JDShake.notify += `${
also ? `\n` : ``
}京东商城-摇摇: 成功, 明细: 未知 ⚠️${also ? ` (多次)` : ``}`;
}
if (cc.data.luckyBox.freeTimes != 0) {
await JingDongShake(s);