forked from dream385/decode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutput.js
More file actions
1753 lines (1753 loc) · 69.4 KB
/
output.js
File metadata and controls
1753 lines (1753 loc) · 69.4 KB
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
//4/28/2025, 6:22:33 PM
//Project:https://github.com/dream385/decode
let _0x5d550b = "http://doc.zhanyc.cn/pages/zggbwlxy/";
let _0x368bdd = true;
let _0x706d8e = true;
let _0x13b3e6 = true;
_0x368bdd = false;
_0x706d8e = false;
_0x13b3e6 = false;
const _0x4f429b = {
version: "202504101508",
body: "<div style=\"padding:10px;\">第一版本</div>"
};
const _0x508481 = {
tjjl: "推荐购买脚本,返佣40%",
version: _0x4f429b
};
const _0x1b663d = {
list: null
};
const _0x18eeec = {
index: null
};
const _0x488a39 = {
title: "深入学习贯彻习近平新时代中国特色社会主义思想专栏",
list: ["https://cela.gwypx.com.cn/portal/playnew.do?menu=course&id=73118336&year=", "aaa"]
};
const _0x281f66 = {
confirmRunIndex: null,
userNameIndex: null,
page_playcourseIndex: null,
waitTime: 0,
index: _0x1b663d,
video: _0x18eeec,
ztList: [_0x488a39]
};
const _0x4179e7 = {
showErr: true
};
const _0x5d967e = {
showErr: true
};
const _0x445b35 = {
showErr: true
};
let _0x4906ec = Object.assign(baseConfig, {
setting: _0x508481,
pageData: _0x281f66,
openDoc() {
window.open(_0x5d550b);
},
async init() {
console.log("%c init", "background:rgb(0,0,0);color:#fff");
if (unsafeWindow.window === unsafeWindow.top) {
_0x4906ec.addMenu();
_0x4906ec.registerMenuCommandTemplate();
}
this.addStyle();
if (location.href.indexOf("loginSuccess.html?yh=") != -1) {
console.log("%c loginSuccess.html?yh", "background:rgb(255,0,0);color:#fff");
_0x4906ec.page_yhwelcome();
}
let _0x40d782 = await _0x4906ec.checkVersion();
if (!_0x40d782) {
return;
}
let _0x16a004 = location.href;
setInterval(async () => {
if (_0x16a004 != location.href) {
_0x16a004 = location.href;
_0x4906ec.runByUrl(location.href);
}
}, 500);
_0x4906ec.runByUrl(location.href);
},
async addMenu() {
await _0x4906ec.waitOf(_0x5aa0fa => $("body:visible").length > 0);
if ($("#zfkLeftMenuContainer").length > 0) {
return;
}
GM_addStyle("#zfkLeftMenuContainer{z-index:9999;position:fixed;left:0;top:40%;color:#fff;box-shadow:0 0 10px #00ffcc,0 0 20px #00ffcc,0 0 30px #00ffcc;animation:glowAnimation 3s infinite alternate;}@keyframes glowAnimation{0%{box-shadow:0 0 10px #00ffcc,0 0 20px #00ffcc,0 0 30px #00ffcc;}20%{box-shadow:0 0 15px #ff66cc,0 0 25px #ff66cc,0 0 35px #ff66cc;}40%{box-shadow:0 0 10px #ffcc33,0 0 20px #ffcc33,0 0 30px #ffcc33;}60%{box-shadow:0 0 15px #66ff66,0 0 25px #66ff66,0 0 35px #66ff66;}80%{box-shadow:0 0 10px #3399ff,0 0 20px #3399ff,0 0 30px #3399ff;}100%{box-shadow:0 0 10px #fffb00,0 0 20px #fffb00,0 0 30px #fffb00;}}#zfkLeftMenuContainer .zfkLeftMenuStep{position:absolute;background:#3498db;width:max-content;top:-35px;display:block;padding:6px}#zfkLeftMenuContainer .zfkLeftMenu{background:rgba(0,0,0,0.4);border-radius:0 4px 4px 0;padding:6px}#zfkLeftMenuContainer .zfkLeftMenu:hover .zfkLeftMenuBtn-titile{width:auto}#zfkLeftMenuContainer .zfkLeftMenu .zfkLeftMenuBtn-titile{cursor:pointer;word-wrap:break-word;width:1em;display:inline-block}#zfkLeftMenuContainer .zfkLeftMenu .zfkLeftMenuBtnUl{display:none;margin:0 -6px;box-sizing:border-box}#zfkLeftMenuContainer .zfkLeftMenu .zfkLeftMenuBtnUl li{list-style:none;color:#fff !important;cursor:pointer;padding:6px}#zfkLeftMenuContainer .zfkLeftMenu .zfkLeftMenuBtnUl li:hover{background:#000}#zfkLeftMenuContainer .zfkLeftMenu .zfkLeftMenuBtnUl li::before{content:\"+ \"}#zfkIp51Config{padding:10px}#zfkLeftMenuContainer *{font-size:14px}");
$("<div id=\"zfkLeftMenuContainer\">\n <div class=\"zfkLeftMenu\">\n <span class=\"zfkLeftMenuBtn-titile\">菜单</span>\n <ul class=\"zfkLeftMenuBtnUl\">\n </ul>\n \n </div>\n </div>").appendTo("body");
$(".zfkLeftMenu").hover(() => {
$(".zfkLeftMenuBtnUl").show();
}, () => {
$(".zfkLeftMenuBtnUl").hide();
});
},
async runByUrl(_0x3cb48f) {
if (_0x4906ec.matchUrl("dsfa/nc/pc/main/views/main.html")) {
_0x4906ec.setUserName();
return;
}
if (_0x4906ec.matchUrl("student/class_myNotFinishClassList.do")) {
_0x4906ec.setUserName2();
return;
}
if (_0x4906ec.matchUrl("dsfa/nc/ztzl/ztzxkc/views/xisijuan.html")) {
_0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455").then(_0x597e44 => {
_0x4906ec.page_list();
});
} else {
if (_0x4906ec.matchUrl("course/views/course.html")) {
_0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455").then(_0x9f0273 => {
_0x4906ec.page_video();
});
} else {
if (_0x4906ec.matchUrl("/student/class_detail_course.do")) {
await _0x4906ec.setUserName2();
_0x4906ec.page_class_detail_course();
} else {
if (_0x4906ec.matchUrl("/portal/course_detail.do")) {
_0x4906ec.page_course_detail();
} else {
if (_0x4906ec.matchUrl("/portal/playcourse.do?")) {
_0x4906ec.page_playcourse();
} else {
if (_0x4906ec.matchUrl("/home/personal/index")) {
_0x4906ec.setUserName_page_personal();
} else {
if (_0x4906ec.matchUrl("/portal/special_recommend_hot.do?")) {
_0x4906ec.page_special_recommend_hot();
} else {
if (_0x4906ec.matchUrl("course_myselect.do?") || _0x4906ec.matchUrl("/course_myrequired.do?") || _0x4906ec.matchUrl("/student/my_course.do?")) {
await _0x4906ec.setUserName3();
_0x4906ec.page_list2();
} else {
if (_0x4906ec.matchUrl("/views/specialDetail.html?")) {
await _0x4906ec.setUserName();
_0x4906ec.page_list3();
} else {
if (_0x4906ec.matchUrl("/pdchanel/specialdetail?")) {
_0x4906ec.page_list_specialdetail();
} else {
if (_0x4906ec.matchUrl("/home/default")) {
await _0x4906ec.setUserName_homeDefault();
_0x4906ec.tipsMsg("脚本初始化完毕");
} else {
if (_0x4906ec.matchUrl("/pagecourse/coursePlayer?")) {
_0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455").then(_0xe520b0 => {
_0x4906ec.page_video();
});
} else {
if (_0x4906ec.matchUrl("/nc/pagespecial/specialDetail?")) {
await _0x4906ec.setUserName_http();
_0x4906ec.page_list4();
} else {
if (_0x4906ec.matchUrl("class/detail")) {
await _0x4906ec.setUserName_http();
_0x4906ec.page_list4();
} else {
if (_0x3cb48f == "https://www.cela.gov.cn/home/" || _0x3cb48f == "https://www.cela.gov.cn/") {
_0x4906ec.setUserName4();
} else {
if (_0x3cb48f.includes("/train-new/class-detail/")) {
_0x4906ec.page_listClassDetail();
} else {
if (_0x3cb48f.includes("/study/course/detail/")) {
_0x4906ec.page_video_detail();
} else {
if (_0x3cb48f.includes("/portal/study_play.do?")) {
_0x4906ec.page_video_study_play();
} else {
if (_0x3cb48f.includes("/pageonstudy/studyCenter")) {
await _0x4906ec.setUserName_zggdgb();
_0x4906ec.tipsMsg("手动进入课程章节列表页面后,脚本自动运行");
} else {
if (_0x3cb48f.includes("/pagechannel/channelDetail")) {
_0x4906ec.page_channelDetail();
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},
setHook() {
ah.proxy({
onRequest: (_0x5f117f, _0x2dc0f9) => {
console.log(_0x5f117f.url);
_0x2dc0f9.next(_0x5f117f);
},
onError: (_0x3d9a0d, _0xaf8b91) => {
console.log(_0x3d9a0d.type);
_0xaf8b91.next(_0x3d9a0d);
},
onResponse: (_0xc89d9b, _0x464e4e) => {
let _0x2c73fe = _0xc89d9b.config.url;
if (_0x2c73fe.includes("/device/study_sync.do")) {
debugger;
}
console.log(_0xc89d9b.response);
_0x464e4e.next(_0xc89d9b);
}
}, unsafeWindow.window);
},
async page_video_study_play() {
console.log("%c page_video_study_play", "background:rgb(0,0,0);color:#fff");
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
_0x4906ec.closeWaitConfrimWin();
_0x4906ec.waitOf(_0x2efddd => _0x4906ec.getElByText($(".user_choise"), "继续学习") != null).then(async _0x156ff0 => {
await _0x4906ec.waitTimeout(500);
_0x4906ec.getElByText($(".user_choise"), "继续学习").click();
});
let _0x56d0d1 = 2;
let _0x49fe28 = null;
let _0x9c0444 = 60;
let _0x2bda83 = _0x9c0444;
_0x4906ec.closeWaitConfrimWin();
if (_0x4906ec.pageData.video.index != null) {
return;
}
setTimeout(async () => {
let _0x41e32a = _0x4906ec.getCurTime();
await _0x4906ec.waitTimeout(5000);
if (_0x4906ec.getCurTime() == _0x41e32a) {
_0x4906ec.confirmRun("貌似卡主了,3秒后刷新页面").then(_0x5251d9 => {
location.reload();
});
}
}, 60000);
_0x4906ec.pageData.video.index = setInterval(async () => {
try {
if (_0x4906ec.pageData.waitTime > 0) {
_0x4906ec.pageData.waitTime -= _0x56d0d1;
return;
}
if (!_0x4906ec.getVideo()) {
console.log("%c zfk no video", "background:rgb(0,0,0);color:#fff");
return;
}
let _0x18a783 = _0x4906ec.getCurTime();
if (_0x18a783 == _0x49fe28) {
_0x49fe28 = _0x4906ec.getCurTime();
_0x2bda83 -= _0x56d0d1;
if (_0x2bda83 <= 0) {
_0x2bda83 = _0x9c0444;
_0x4906ec.confirmRun("貌似卡死了,前往列表页面").then(_0x5d5605 => {
location.href = _0x4906ec.getGMData("courseDetailUrl", "/");
});
_0x4906ec.pageData.waitTime = 10;
return;
}
} else {
_0x49fe28 = _0x18a783;
_0x2bda83 = _0x9c0444;
}
_0x4906ec.getVideo().volume = 0;
let _0x547e89 = "进度:" + _0x4906ec.getCurTime().toFixed(0) + "/" + _0x4906ec.getTotalTime().toFixed(0);
$("title").text(_0x547e89);
console.log("%c video run", "background:rgb(255,0,0);color:#fff");
let _0x19e702 = _0x4906ec.getElByText(".layui-layer-content p", "您好,本平台要求实时在线学习,点击按钮,继续学习课程。");
if (_0x19e702 != null) {
_0x19e702.parents(".layui-layer").find(".layui-layer-btn0")[0].click();
}
let _0x1c5869 = await _0x4906ec.isPlayFinish();
if (_0x1c5869) {
_0x4906ec.pageData.waitTime = 15;
const _0x4bde1e = {
time: 10000
};
layer.msg("视频即将结束,等待下一步操作", _0x4bde1e);
setTimeout(() => {
_0x4906ec.confirmRun("前往列表页面").then(_0x5aa70d => {
location.href = _0x4906ec.getGMData("listUrl", "/");
});
}, 10000);
clearInterval(_0x4906ec.pageData.video.index);
_0x4906ec.pageData.video.index = null;
return;
}
let _0x332b26 = await _0x4906ec.videoIsPlay();
if (!_0x332b26) {
if (!_0x1c5869) {
_0x4906ec.play();
}
}
} catch (_0x5607a5) {
console.error("视频页面定时器出错", _0x5607a5);
}
}, _0x56d0d1 * 1000);
},
async page_video_detail() {
_0x4906ec.closeWaitConfrimWin();
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
console.log("%c page_video_detail", "background:rgb(0,0,0);color:#fff");
let _0x4c46c4 = 2;
let _0xa8234 = null;
let _0x45f727 = 60;
let _0x9702dc = _0x45f727;
_0x4906ec.closeWaitConfrimWin();
if (_0x4906ec.pageData.video.index != null) {
return;
}
setTimeout(async () => {
let _0x3f6ddc = _0x4906ec.getCurTime();
await _0x4906ec.waitTimeout(5000);
if (_0x4906ec.getCurTime() == _0x3f6ddc) {
_0x4906ec.confirmRun("貌似卡主了,3秒后刷新页面").then(_0x10050d => {
location.reload();
});
}
}, 60000);
_0x4906ec.pageData.video.index = setInterval(async () => {
try {
if (_0x4906ec.pageData.waitTime > 0) {
_0x4906ec.pageData.waitTime -= _0x4c46c4;
return;
}
if (!_0x4906ec.getVideo()) {
console.log("%c zfk no video", "background:rgb(0,0,0);color:#fff");
return;
}
let _0x8a0248 = _0x4906ec.getCurTime();
if (_0x8a0248 == _0xa8234) {
_0xa8234 = _0x4906ec.getCurTime();
_0x9702dc -= _0x4c46c4;
if (_0x9702dc <= 0) {
_0x9702dc = _0x45f727;
_0x4906ec.confirmRun("貌似卡死了,前往列表页面").then(_0x5a9ba9 => {
location.href = _0x4906ec.getGMData("listUrl", "/");
});
_0x4906ec.pageData.waitTime = 10;
return;
}
} else {
_0xa8234 = _0x8a0248;
_0x9702dc = _0x45f727;
}
_0x4906ec.getVideo().volume = 0;
let _0x54e7d = "进度:" + _0x4906ec.getCurTime().toFixed(0) + "/" + _0x4906ec.getTotalTime().toFixed(0);
$("title").text(_0x54e7d);
console.log("%c video run", "background:rgb(255,0,0);color:#fff");
let _0x18ffea = _0x4906ec.getElByText(".layui-layer-content p", "您好,本平台要求实时在线学习,点击按钮,继续学习课程。");
if (_0x18ffea != null) {
_0x18ffea.parents(".layui-layer").find(".layui-layer-btn0")[0].click();
}
let _0x1413c0 = await _0x4906ec.isPlayFinish();
if (_0x1413c0) {
_0x4906ec.pageData.waitTime = 15;
layer.msg("视频即将结束,等待下一步操作", {
time: 10000
});
setTimeout(() => {
_0x4906ec.confirmRun("准备前往列表页面").then(_0x10b5da => {
location.href = _0x4906ec.getGMData("listUrl", "/");
});
}, 10000);
clearInterval(_0x4906ec.pageData.video.index);
_0x4906ec.pageData.video.index = null;
return;
}
let _0x13613c = await _0x4906ec.videoIsPlay();
if (!_0x13613c) {
if (!_0x1413c0) {
_0x4906ec.play();
}
}
} catch (_0xef80c9) {
console.error("视频页面定时器出错", _0xef80c9);
}
}, _0x4c46c4 * 1000);
},
async page_channelDetail() {
console.log("%c page_channelDetail", "background:rgb(0,0,0);color:#fff");
_0x4906ec.closeWaitConfrimWin();
if (!_0x4906ec.getUserName()) {
location.href = "https://www.cela.gov.cn/home/";
return;
}
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
await _0x4906ec.waitOf(_0x5bc88d => _0x4906ec.getElByText($("[role=\"tab\"]"), "章节") != null);
await _0x4906ec.waitTimeout(1000);
_0x4906ec.getElByText($("[role=\"tab\"]"), "章节").click();
await _0x4906ec.waitOf(_0x153b4b => $(".body-content .el-progress__text").length > 0);
let _0x1d3823 = null;
$(".body-content .el-progress__text").each((_0x5a2720, _0x392d65) => {
let _0x3a8c49 = Number($(_0x392d65).text().trim().replace("%", ""));
if (_0x3a8c49 < 100) {
_0x1d3823 = $(_0x392d65);
return false;
}
});
if (_0x1d3823 == null) {
_0x4906ec.alertMsg("学习完成");
return;
}
_0x4906ec.setGMData("listUrl", location.href);
_0x4906ec.confirmRun("3秒后执行下一步", 3000).then(_0x224447 => {
_0x1d3823.parents(".body-content:first").find("dd.handle").click();
_0x4906ec.openLjTips();
});
},
async page_listClassDetail() {
console.log("%c page_listClassDetail", "background:rgb(0,0,0);color:#fff");
_0x4906ec.closeWaitConfrimWin();
if (!_0x4906ec.getUserName()) {
location.href = "https://www.cela.gov.cn/home/";
return;
}
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
await _0x4906ec.waitOf(_0x39428a => $(".progress i").length > 0);
let _0x19e453 = null;
$(".progress i").each((_0x41742e, _0x9c419f) => {
let _0x2ffe42 = Number($(_0x9c419f).text().trim().replace("%", ""));
if (_0x2ffe42 < 100) {
_0x19e453 = $(_0x9c419f);
return false;
}
});
if (_0x19e453 == null) {
_0x4906ec.alertMsg("学习完成");
return;
}
_0x4906ec.setGMData("listUrl", location.href);
_0x4906ec.confirmRun("3秒后执行下一步", 3000).then(_0x1ec11a => {
_0x19e453.parents(".cont:first").find("a.normal")[0].click();
_0x4906ec.openLjTips();
});
},
async page_list2() {
console.log("%c page_list", "background:rgb(0,0,0);color:#fff");
_0x4906ec.closeWaitConfrimWin();
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
await _0x4906ec.waitOf(_0x572595 => $(".hoz_course_row").length > 0);
let _0x17041f = null;
$(".hoz_course_row").each((_0x2c9d33, _0x6535b2) => {
let _0x749586 = Number($(_0x6535b2).find(".gp-classW3").text().trim().replace("%", ""));
if (_0x749586 < 100) {
_0x17041f = $(_0x6535b2);
return false;
}
});
if (_0x17041f == null) {
layer.alert("学习完成,如果结果有误,请使用`脚本菜单`中的清理缓存功能后再试");
return;
}
_0x4906ec.setGMData("listUrl", location.href);
_0x4906ec.confirmRun("3秒后执行下一步", 3000).then(_0x51ae87 => {
_0x17041f.find("h2 a")[0].click();
_0x4906ec.openLjTips();
});
},
async page_list_specialdetail() {
console.log("%c page_list_specialdetail", "background:rgb(0,0,0);color:#fff");
_0x4906ec.closeWaitConfrimWin();
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
await _0x4906ec.waitOf(_0x4b4321 => $(".catalogue_item").length > 0);
let _0x4b7545 = null;
let _0x2fd641 = _0x4906ec.getGMData("finishVideoList", []);
$(".catalogue_item").each((_0x401719, _0x1e8e4d) => {
let _0x11d9b9 = $(_0x1e8e4d).find(".item-title").text().trim();
if (!_0x2fd641.includes(_0x11d9b9)) {
_0x4b7545 = $(_0x1e8e4d);
return false;
}
});
if (_0x4b7545 == null) {
layer.alert("学习完成,如果结果有误,请使用`脚本菜单`中的清理缓存功能后再试");
return;
}
_0x4906ec.setGMData("listUrl", location.href);
_0x4906ec.confirmRun("3秒后执行下一步", 3000).then(_0x155de8 => {
_0x4b7545.find(".item-title").click();
_0x4906ec.openLjTips();
});
},
async page_list3() {
console.log("%c page_list3", "background:rgb(0,0,0);color:#fff");
_0x4906ec.closeWaitConfrimWin();
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
await _0x4906ec.waitOf(_0x342d96 => $(".normalitemContent").length > 0);
let _0x191541 = null;
let _0x352748 = _0x4906ec.getGMData("finishVideoList", []);
$(".normalitemContent").each((_0x3725e1, _0xd41bf9) => {
let _0x101d07 = $(_0xd41bf9).find(".-item-title").attr("title");
if (!_0x352748.includes(_0x101d07)) {
_0x191541 = $(_0xd41bf9);
return false;
}
});
if (_0x191541 == null) {
layer.alert("学习完成,如果结果有误,请使用`脚本菜单`中的清理缓存功能后再试");
return;
}
_0x4906ec.setGMData("listUrl", location.href);
_0x4906ec.confirmRun("3秒后执行下一步", 3000).then(_0x1eaa72 => {
_0x191541.find(".-item-title").click();
_0x4906ec.openLjTips();
});
},
async page_list4() {
console.log("%c page_list4", "background:rgb(0,0,0);color:#fff");
_0x4906ec.closeWaitConfrimWin();
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
await _0x4906ec.waitOf(_0x4db27b => $(".dsf_nc_special_detail_course_item [role=\"progressbar\"]").length > 0);
_0x4906ec.tipsMsg("等待脚本操作");
let _0x44dfa8 = null;
await _0x4906ec.waitTimeout(1000);
$(".dsf_nc_special_detail_course_item [role=\"progressbar\"]").each((_0x23324c, _0x4703a4) => {
let _0x31cc14 = $(_0x4703a4).parents(".detail_desc_item:first").find(".enter_btn").attr("style");
if (_0x31cc14 && _0x31cc14.includes("background: rgb(170, 170, 170)")) {
return true;
}
let _0x490e84 = Number($(_0x4703a4).attr("aria-valuenow"));
if (_0x490e84 <= 99) {
_0x44dfa8 = $(_0x4703a4);
return false;
}
});
if (_0x44dfa8 == null) {
layer.alert("学习完成,如果结果有误,请使用`脚本菜单`中的清理缓存功能后再试");
return;
}
_0x4906ec.setGMData("listUrl", location.href);
_0x4906ec.confirmRun("3秒后执行下一步", 3000).then(_0x3b778d => {
_0x44dfa8.parents(".detail_desc_item:first").find(".enter_btn").click();
_0x4906ec.openLjTips();
});
},
async page_special_recommend_hot() {
console.log("%c page_special_recommend_hot", "background:rgb(255,0,0);color:#fff");
_0x4906ec.closeWaitConfrimWin();
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
await _0x4906ec.waitOf(_0x2cd2fe => $("a.cc_item").length > 0);
await _0x4906ec.waitTimeout(1000);
let _0x36c13b = _0x4906ec.getGMData("finishVideoList", []);
let _0x537928 = null;
$("a.cc_item").each((_0x7cd460, _0x1cb9b8) => {
let _0x2f8e93 = $(_0x1cb9b8).find(".cc_title").attr("title");
if ($(_0x1cb9b8).find(".h_pro_percent").length > 0) {
let _0x412639 = Number($(_0x1cb9b8).find(".h_pro_percent").text().replace("%", ""));
if (_0x412639 >= 100) {
return true;
}
}
if (!_0x36c13b.includes(_0x2f8e93)) {
_0x537928 = $(_0x1cb9b8);
return false;
}
});
if (_0x537928 == null) {
layer.alert("学习完成,如果结果有误,请使用`脚本菜单`中的清理缓存功能后再试");
return;
}
_0x4906ec.setGMData("listUrl", location.href);
_0x4906ec.confirmRun("3秒后执行下一步", 3000).then(_0x3bca4b => {
_0x537928[0].click();
_0x4906ec.openLjTips();
});
},
async setUserName_homeDefault() {
return new Promise(async (_0x2f8a39, _0x3ea70a) => {
await this.waitOf(_0x27f920 => _0x4906ec.getElByText($("label"), "您好,", "startsWith") != null);
this.setGMData("username", _0x4906ec.getElByText($("label"), "您好,", "startsWith").text().trim().replace("您好,", ""));
if (_0x706d8e) {
console.log("userName=>" + _0x4906ec.getGMData("username"));
}
return _0x2f8a39(true);
});
},
async setUserName_zggdgb() {
return new Promise(async (_0x30ccc1, _0x292457) => {
let _0x1c0064 = "";
await _0x4906ec.waitOf(_0x5dc39c => {
try {
_0x1c0064 = $(".username").text().replace("欢迎您,", "").trim();
if (_0x1c0064 && _0x1c0064 != "") {
_0x706d8e && _0x4906ec.tipsMsg("username=" + _0x1c0064);
_0x4906ec.setGMData("username", _0x1c0064);
return true;
}
return false;
} catch (_0x2a3875) {
return false;
}
});
return _0x30ccc1(_0x1c0064);
});
},
async setUserName_http() {
return new Promise(async (_0x5764c6, _0x3063f8) => {
await _0x4906ec.waitOf(_0x1813b1 => unsafeWindow.$ && unsafeWindow.$().jquery);
unsafeWindow.$.get("/dsf5/nc/org/user/detail", _0x3ff6d8 => {
let _0x238b19 = JSON.parse(_0x3ff6d8).data.name;
_0x4906ec.setGMData("username", _0x238b19);
return _0x5764c6();
});
});
},
async setUserName_page_personal() {
return new Promise(async (_0x3eecdd, _0x34b672) => {
await this.waitOf(_0x44fe65 => $(".studyCon div>em").text().trim() != "");
this.setGMData("username", $(".studyCon div>em").text().trim());
return _0x3eecdd(true);
});
},
async page_playcourse() {
console.log("%c page_playcourse", "background:rgb(255,0,0);color:#fff");
_0x4906ec.closeWaitConfrimWin();
await _0x4906ec.gmAuthDownScore("8c43521db9f5412693e48606a6291455");
let _0x47a70a = 2;
_0x4906ec.pageData.page_playcourseIndex = setInterval(async () => {
try {
if (_0x4906ec.pageData.waitTime > 0) {
_0x4906ec.pageData.waitTime -= _0x47a70a;
return;
}
if (!location.href.includes("/portal/playcourse.do?")) {
return;
}
console.log("%c video run", "background:rgb(255,0,0);color:#fff");
let _0x100da0 = await _0x4906ec.isPlayFinish();
if (_0x100da0) {
layer.msg("视频即将结束,等待下一步操作", {
time: 10000
});
_0x4906ec.pageData.waitTime = 15;
_0x4906ec.page_playcourseNextVideo();
return;
}
let _0x5d3c18 = await _0x4906ec.videoIsPlay();
if (!_0x5d3c18) {
if (!_0x100da0) {
_0x4906ec.play();
}
}
} catch (_0x97ac50) {
console.error("视频页面定时器出错", _0x97ac50);
}
}, _0x47a70a * 1000);
},
async page_playcourseNextVideo() {
if ($(".menu_item").index($(".menu_item.currentChapter")) == $(".menu_item").length - 1) {
setTimeout(() => {
let _0x2bda9c = $(".course_name").text().trim();
let _0x129057 = _0x4906ec.getGMData("finishVideoList", []);
_0x129057.push(_0x2bda9c);
_0x4906ec.setGMData("finishVideoList", _0x129057);
_0x4906ec.confirmRun("准备前往列表页面").then(_0x55f59a => {
top.location.href = _0x4906ec.getGMData("listUrl", "/");
});
}, 7000);
} else {
const _0x4f1f14 = {
time: 5000
};
layer.msg("等待自动切换下一集", _0x4f1f14);
}
},
async page_course_detail() {
await this.waitOf(_0x10fa06 => $(".hover_btn").length > 0);
_0x4906ec.closeWaitConfrimWin();
if ($(".hover_btn").text() == "我要选课") {
_0x4906ec.confirmRun("检测到未选课,3秒后自动选课").then(_0x1f3cfe => {
$(".hover_btn")[0].click();
setTimeout(() => {
location.reload();
}, 3000);
});
} else {
_0x4906ec.confirmRun().then(_0x764b5e => {
$(".hover_btn")[0].click();
_0x4906ec.openLjTips();
});
}
},
async page_class_detail_course() {
console.log("%c video page_class_detail_course", "background:rgb(255,0,0);color:#fff");
await this.waitOf(_0x25700a => $(".h_pro_percent").length > 0);
_0x4906ec.closeWaitConfrimWin();
await this.waitTimeout(500);
let _0x4da984 = null;
$(".h_pro_percent").each((_0x46356d, _0x525fc9) => {
if ($(_0x525fc9).text().trim() != "100.0%") {
_0x4da984 = $(_0x525fc9);
return false;
}
});
if (_0x4da984 == null) {
layer.alert("学习完成");
return;
}
_0x4906ec.setGMData("listUrl", location.href);
this.confirmRun().then(_0x349f8d => {
_0x4da984.parents(".hoz_course_row:first").find(".hoz_course_name>a")[0].click();
});
},
async setUserName2() {
return new Promise(async (_0x3d004e, _0xba835e) => {
await this.waitOf(_0x7025f5 => $(".center_user>span>span").text().trim() != "");
let _0xf43191 = $(".center_user>span>span").text().trim();
_0x706d8e && _0x4906ec.tipsMsg(_0xf43191);
this.setGMData("username", _0xf43191);
return _0x3d004e(true);
});
},
async setUserName3() {
return new Promise(async (_0x521a94, _0x5a9820) => {
let _0x5939cb = "";
let _0x63731d = layer.load();
await _0x4906ec.waitOf(_0x2c4453 => {
_0x5939cb = $(".center_user").text().trim().replace(/[欢迎学员]/g, "").trim();
if (_0x5939cb != "") {
_0x4906ec.setGMData("username", _0x5939cb);
layer.close(_0x63731d);
return true;
}
return false;
});
return _0x521a94(_0x5939cb);
});
},
setUserName() {
if (_0x4906ec.pageData.userNameIndex != null) {
return;
}
_0x4906ec.setUserNameFun();
_0x4906ec.pageData.userNameIndex = setInterval(() => {
_0x4906ec.setUserNameFun();
}, 500);
},
setUserName4() {
return new Promise(async (_0x5624d8, _0x390863) => {
_0x706d8e && console.log("setUserName4");
let _0x454dd6 = "";
await _0x4906ec.waitOf(_0x3e2061 => _0x4906ec.getElByText($("a"), "退出登录") != null);
await _0x4906ec.waitOf(_0x4c91ed => {
try {
_0x454dd6 = _0x4906ec.getElByText($("a"), "退出登录").prev().text().replace("您好,", "");
if (_0x454dd6 && _0x454dd6 != "") {
_0x4906ec.setGMData("username", _0x454dd6);
return true;
}
return false;
} catch (_0x2c7d95) {
return false;
}
});
return _0x5624d8(_0x454dd6);
});
},
setUserNameFun() {
console.log("fun");
let _0xc1bff9 = $(".user-has-login .user-wel-text").text().trim();
if (_0xc1bff9 != "") {
if (_0xc1bff9.indexOf("欢迎您") != -1) {
_0xc1bff9 = _0xc1bff9.replace("欢迎您,", "").replace(" 修改密码", "").replace("退出登录", "").trim();
}
_0x4906ec.setGMData("username", _0xc1bff9);
clearInterval(_0x4906ec.pageData.userNameIndex);
let _0x3659ac = _0x4906ec.getUrlParam("zform");
if (_0x3659ac) {
top.location.href = decodeURIComponent(_0x3659ac);
}
}
},
openConfig() {
let _0x594193 = "\n <div class=\"p-10 zfk-container\">\n <form class=\"zfk-form\">\n <div class=\"zfk-form-item block\">\n <label>学习的专题</label>\n <div>\n <label><input type=\"radio\" name=\"radioVal\" value=\"1\" />选项1</label>\n </div>\n <div>\n <label><input type=\"radio\" name=\"radioVal\" value=\"1\" />选项1</label>\n </div>\n <div>\n <label><input type=\"radio\" name=\"radioVal\" value=\"1\" />选项1</label>\n </div>\n </div>\n <div class=\"zfk-form-item block\">\n <label>学习模式</label>\n <label\n ><input type=\"radio\" name=\"mode\" value=\"1\" />学习选中专题</label\n >\n <label\n ><input\n type=\"radio\"\n name=\"mode\"\n value=\"2\"\n />内置适配模式(只适配了部分专题)</label\n >\n </div>\n <div class=\"zfk-form-item block\">\n <label></label>\n <button class=\"zfk-btn\" onclick=\"zfk.saveConfig()\" type=\"button\">\n 保存\n </button>\n <button\n class=\"zfk-btn danger\"\n onclick=\"zfk.closeConfig()\"\n type=\"button\"\n >\n 关闭\n </button>\n </div>\n </form>\n </div>\n ";
const _0x324d47 = {
type: "1",
title: "设置",
content: _0x594193,
btn: false,
area: ["600px", "600px"]
};
layer.open(_0x324d47);
let _0xdfed44 = _0x4906ec.getConfig();
_0x4906ec.setFormVal(".zfk-form", _0xdfed44);
},
getElByText(_0x5e25c7, _0x559304, _0x4d48ed = "eq", _0x505491 = true) {
let _0xf5c5b2 = null;
$(_0x5e25c7).each((_0x4bccef, _0x1cd491) => {
if (_0x505491 && !$(_0x1cd491).is(":visible")) {
return true;
}
if (_0x4d48ed == "eq" && $(_0x1cd491).text().trim() == _0x559304) {
_0xf5c5b2 = $(_0x1cd491);
return false;
} else {
if (_0x4d48ed == "startsWith" && $(_0x1cd491).text().trim().startsWith(_0x559304)) {
_0xf5c5b2 = $(_0x1cd491);
return false;
} else {
if (_0x4d48ed == "endsWith" && $(_0x1cd491).text().trim().endsWith(_0x559304)) {
_0xf5c5b2 = $(_0x1cd491);
return false;
}
}
}
});
return _0xf5c5b2;
},
getElListByText(_0x394f2b, _0x581f9c, _0x3b6ed2 = "eq", _0x4899b5 = true) {
let _0x2191f2 = [];
$(_0x394f2b).each((_0x7c9daf, _0x49e7b1) => {
if (_0x4899b5 && !$(_0x394f2b).is(":visible")) {
return true;
}
if (_0x3b6ed2 == "eq" && $(_0x49e7b1).text().trim() == _0x581f9c) {
_0x2191f2.push($(_0x49e7b1));
} else {
if (_0x3b6ed2 == "startsWith" && $(_0x49e7b1).text().trim().startsWith(_0x581f9c)) {
_0x2191f2.push($(_0x49e7b1));
} else {
if (_0x3b6ed2 == "endsWith" && $(_0x49e7b1).text().trim().endsWith(_0x581f9c)) {
_0x2191f2.push($(_0x49e7b1));
}
}
}
});
return _0x2191f2;
},
setFormVal(_0x4e6b6b, _0x52ff43) {
$.each(_0x52ff43, function (_0x1ed069, _0x4cb0b4) {
let _0x308e74 = $(_0x4e6b6b).find("[name=\"" + _0x1ed069 + "\"]");
if (_0x308e74.length == 0) {
return true;
} else {
if (_0x308e74.length == 1) {
let _0x5aafa9 = _0x308e74.eq(0).attr("type");
switch (_0x5aafa9) {
case "radio":
case "checkbox":
if (_0x308e74.val() == _0x4cb0b4) {
_0x308e74.prop("checked", true);
}
break;
default:
_0x308e74.val(_0x4cb0b4);
break;
}
} else {
_0x308e74.each((_0x35f8fd, _0x44dac2) => {
if (_0x4cb0b4.includes($(_0x44dac2).val())) {
$(_0x44dac2).prop("checked", true);
}
});
}
}
});
},
getFormVal(_0x3f202a) {
let _0x5e4194 = {};
var _0x46c894 = $(_0x3f202a).serializeArray();
let _0x3270f6 = [];
$.each(_0x46c894, function () {
console.log(this);
if (!_0x3270f6.includes(this.name)) {
_0x3270f6.push(this.name);
_0x5e4194[this.name] = this.value;
} else {
let _0xc2b8d = _0x5e4194[this.name];
if (Array.isArray(_0xc2b8d)) {
_0x5e4194[this.name].push(this.value);
} else {
_0x5e4194[this.name] = [_0x5e4194[this.name], this.value];
}
}
});
return _0x5e4194;
},
getConfig() {
let _0x5b23ed = GM_getValue("config", {});
const _0xa14009 = {
bs: 1,
mode: "2"
};
_0x5b23ed = Object.assign(_0xa14009, _0x5b23ed);
return _0x5b23ed;
},
setConfig(_0x267383, _0x5adb88 = "") {
console.log("setConfig" + _0x5adb88, JSON.stringify(_0x267383));
GM_setValue("config", _0x267383);
},
saveConfig() {
var _0x19b4e1 = _0x4906ec.getFormVal(".zfk-form");
console.log(_0x19b4e1);
_0x4906ec.setConfig(_0x19b4e1);
layer.msg("保存成功");
},
closeConfig() {
layer.closeAll();
},
showVersionAlert(_0x80a1e3 = true) {
let _0x1b1134 = _0x4906ec.getGMData("showVersionAlert", "");
if (!_0x80a1e3 && _0x1b1134 == _0x4906ec.getGMData("version")) {
return;
}
layer.open({
type: "1",
title: "版本号:" + _0x4906ec.setting.version.version,
content: _0x4906ec.setting.version.body,
btn: "我知道了",
area: ["600px", "auto"],
yes: function (_0x345a12) {
_0x4906ec.setGMData("showVersionAlert", _0x4906ec.getGMData("version"));
layer.close(_0x345a12);
}
});
},
async callRegisterMenuCommand(_0x13f2de, _0xc5dfa1) {
if (!_0x4906ec.pageData.menuBtnIndex) {
_0x4906ec.pageData.menuBtnIndex = 0;
}
GM_registerMenuCommand(_0x13f2de, _0xc5dfa1);
await _0x4906ec.waitOf(_0x3d4804 => $("body:visible").length > 0);
await _0x4906ec.waitTimeout(500);
if ($("#zfkLeftMenuContainer").length > 0) {
_0x4906ec.pageData.menuBtnIndex++;
$("#zfkLeftMenuContainer .zfkLeftMenuBtnUl").append("<li id=\"zfkMenuBtn_" + _0x4906ec.pageData.menuBtnIndex + "\">" + _0x13f2de + "</li>");
$("#zfkMenuBtn_" + _0x4906ec.pageData.menuBtnIndex).click(function () {
_0xc5dfa1();
});
}
},
registerMenuCommandTemplate() {
_0x4906ec.callRegisterMenuCommand("清理缓存", _0x4906ec.clearResult);
_0x4906ec.callRegisterMenuCommand("使用说明", _0x4906ec.openDoc);
_0x4906ec.callRegisterMenuCommand("我的信息", _0x4906ec.myInfo);
_0x4906ec.callRegisterMenuCommand("联系作者", _0x4906ec.linkAuthor);
_0x4906ec.callRegisterMenuCommand("版本:" + _0x4906ec.setting.version.version, _0x4906ec.showVersionAlert);
},
linkAuthor() {
window.open("http://doc.zhanyc.cn/contact-me/");
},
setClip(_0x275c38) {
GM_setClipboard(_0x275c38, "text");
layer.msg("复制成功");
},
clearResult() {
if (confirm("确认要清空结果数据吗?")) {
_0x4906ec.delGMData("lastCourse");
_0x4906ec.setGMData("username", "");
_0x4906ec.setGMData("result", []);
_0x4906ec.delGMData("code", []);
_0x4906ec.delGMData("finishVideoList", []);
top.location.href = "https://www.cela.gov.cn/home/personal/index";
layer.msg("清理学习记录完成");
}
},
page_yhwelcome() {
console.log("%c page_yhwelcome", "background:rgb(255,0,0);color:#fff");
var _0x4803c0 = sessionStorage.getItem("token");
_0x4906ec.setGMData("token", _0x4803c0);
_0x4906ec.setGMData("login", {
login: true,
time: _0x4906ec.now()
});
},
async page_list() {
console.log("%c page_list", "background:rgb(0,0,0);color:#fff");
await _0x4906ec.waitOf(_0x537975 => $(".course-wrap .item[data-cid]").length > 0);
let _0x1c4255 = _0x4906ec.getGMData("lastCourse", $(".course-wrap .item[data-cid]").eq(0).data("cid"));
$(".course-inner").before("<div style=\"padding: 10px;background: #517ddb;color: #fff;text-align: center;font-size: 20px;\">请勿关闭该页面,脚本会在该页面为您点击下一门课程</div>");
let _0x22e925 = $("[data-cid=\"" + _0x1c4255 + "\"]").find(".icon-person").next().length > 0;
if (_0x22e925) {
$("[data-cid=\"" + _0x1c4255 + "\"]").click();
} else {
alert("当前页面可以查看的课程已经全部播放完毕");
}
GM_addValueChangeListener("courseFinish", function (_0x144ac6, _0xd9a92c, _0x3dc964, _0x5b73ea) {
console.log("GM_addValueChangeListener courseFinish", _0x3dc964);
_0x1c4255 = _0x4906ec.getGMData("lastCourse", $(".course-wrap .item[data-cid]").eq(0).data("cid"));
if ($("[data-cid=\"" + _0x1c4255 + "\"]").next().length > 0) {
_0x1c4255 = $("[data-cid=\"" + _0x1c4255 + "\"]").next().data("cid");
_0x4906ec.setGMData("lastCourse", _0x1c4255);
let _0x257357 = $("[data-cid=\"" + _0x1c4255 + "\"]").find(".icon-person").next().length > 0;
if (_0x257357) {
$("[data-cid=\"" + _0x1c4255 + "\"]").click();
} else {
alert("当前页面可以查看的课程已经全部播放完毕");
}
} else {
alert("当前页面所有课程已经全部播放完毕");
}
});
},
async nextVideo2() {
let _0x2c0233 = null;
$(".tab-content-desc").each((_0x283918, _0xb99040) => {
let _0x36b560 = Number($(_0xb99040).find("[role=\"progressbar\"]").attr("aria-valuenow"));
if (_0x36b560 < 100) {
layer.msg("切换到第一个未完成视频任务");
$(_0xb99040).click();
_0x2c0233 = $(_0xb99040);