-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path解锁B站大会员番剧、B站视频解析下载.js
1819 lines (1742 loc) · 85.4 KB
/
解锁B站大会员番剧、B站视频解析下载.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
// ==UserScript==
// @name 解锁B站大会员番剧、B站视频解析下载;全网VIP视频免费破解去广告;全网音乐直接下载;油管、Facebook等国外视频解析下载;网盘搜索引擎破解无限下载等
// @namespace super_video_helper_cat
// @version 3.4.3
// @description 【❤️ 视频自动解析,体会拥有VIP的感觉❤️,适配PC+移动 】功能有:1、解锁B站大会员番剧、B站视频解析下载;2、爱奇艺、腾讯、优酷、芒果等全网VIP视频免费破解去广告(免跳出观影特方便);3、网易云音乐、QQ音乐、酷狗、蜻蜓FM、荔枝FM、喜马拉雅等音乐和有声书音频免客户端下载;4、油管、Facebook等国外视频解析下载;5、网盘搜索引擎(来搜一下:laisoyixia.com, 小猪快盘:xiaozhukuaipan.com)破解无限下载;6、优惠券查询等;7、搜索引擎导航【脚本长期维护更新,完全免费,无广告】
// @author 爱画画的猫
// @icon https://cdn.jsdelivr.net/gh/pizcat/static@master/greasyfork_icon.png
// @include *://*.youku.com/v_*
// @include *://*.iqiyi.com/v_*
// @include *://*.iqiyi.com/w_*
// @include *://*.iqiyi.com/a_*
// @include *://*.le.com/ptv/vplay/*
// @include *://v.qq.com/x/cover/*
// @include *://v.qq.com/x/page/*
// @include *://v.qq.com/tv/*
// @include *://*.tudou.com/listplay/*
// @include *://*.tudou.com/albumplay/*
// @include *://*.tudou.com/programs/view/*
// @include *://*.mgtv.com/b/*
// @include *://film.sohu.com/album/*
// @include *://tv.sohu.com/v/*
// @include *://*.bilibili.com/video/*
// @include *://*.bilibili.com/bangumi/play/*
// @include *://*.baofeng.com/play/*
// @include *://vip.pptv.com/show/*
// @include *://v.pptv.com/show/*
// @include *://www.le.com/ptv/vplay/*
// @include *://www.wasu.cn/Play/show/*
//---------------------------------------------------
// @include *://m.v.qq.com/x/cover/*
// @include *://m.v.qq.com/x/page/*
// @include *://m.v.qq.com/*
// @include *://m.iqiyi.com/v_*
// @include *://m.iqiyi.com/w_*
// @include *://m.iqiyi.com/a_*
// @include *://m.youku.com/alipay_video/*
// @include *://m.mgtv.com/b/*
// @include *://m.tv.sohu.com/v/*
// @include *://m.film.sohu.com/album/*
// @include *://m.le.com/ptv/vplay/*
// @include *://m.pptv.com/show/*
// @include *://m.acfun.cn/v/*
// @include *://m.bilibili.com/video/*
// @include *://m.bilibili.com/anime/*
// @include *://m.bilibili.com/bangumi/play/*
// @include *://m.wasu.cn/Play/show/*
//---------------------------------------------------
// @include *://www.youtube.com
// @include *://www.youtube.com/
// @include *://www.youtube.com/watch*
// @include *://www.facebook.com/*
// @include *://yt1s.com/facebook-downloader
//---------------------------------------------------
// @include *music.163.com*
// @include *://y.qq.com*
// @include *://www.kugou.com*
// @include *://www.kuwo.cn*
// @include *://www.lizhi.fm*
// @include *://*.ximalaya.com*
// @include *://music.migu.cn*
//---------------------------------------------------
// @include *://*.taobao.com/*
// @include *://*detail.tmall.com/*
// @include *://*detail.tmall.hk/*
// @include *://*item.jd.com/*
// @include *://item.yiyaojd.com/*
// @include *://npcitem.jd.hk/*
// @include *://www.laisoyixia.com/download/detail**
// @include *://www.xiaozhukuaipan.com/download/**
//----------------------------------------------------
// @include *://www.baidu.com/*
// @include *://www.so.com/s*
// @include *://www.sogou.com/web*
// @include *://cn.bing.com/search*
// @include *://so.toutiao.com/search*
// @require https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.2.1/jquery.min.js
// @connect tt.shuqiandiqiu.com
// @connect api.bilibili.com
// @connect api.staticj.top
// @connect cdn.jsdelivr.net
// @grant unsafeWindow
// @grant GM_openInTab
// @grant GM.openInTab
// @grant GM_getValue
// @grant GM.getValue
// @grant GM_setValue
// @grant GM.setValue
// @grant GM_xmlhttpRequest
// @grant GM.xmlHttpRequest
// @grant GM_registerMenuCommand
// @license AGPL License
// @charset UTF-8
// @antifeature referral-link 【应GreasyFork代码规范要求:含有优惠券功能的脚本必须添加此提示,插件仅提供优惠券提醒和观影相关功能,无任何强制行为】
// @original-author 橘子爱哭
// @original-license AGPL License
// @original-script https://greasyfork.org/zh-CN/scripts/390952
// @run-at document-idle
// ==/UserScript==
(function () {
'use strict';
if (window.top != window.self) {
return;
}
//如果本地值不能满足需求,可自定义添加接口到此处
//注意数据格式
//category=1(全网VIP解析内嵌页播放), category=2(全网VIP解析新建页面播放)
//showType=1(仅PC), showType=2(仅mobile), showType=3(同时显示)
const customizeInterfaceList = [
//{ name:"就是名字而已", category:"1", url:"https://jx.idc126.net/jx/?url=", "showType":3},
//{ name:"就是名字而已", category:"2", url:"https://jx.idc126.net/jx/?url=", "showType":3},
];
//true:对应功能打开,false:对应功能关闭
const functionController = {
"superVideoHelper": true, //VIP视频破解
"superMusicHelper": true, //全网音乐免客户端下载
"queryCoupon": true, //优惠券查询
"wangpanSearchEnginesHelper": true, //网盘搜索引擎破解
"abroadVideoHelper": true, //油管等国外网站视频下载
"searchEnginesNavigation": true //搜索引擎资源导航
}
//视频vip解析收集自脚本:
//https://greasyfork.org/zh-CN/scripts/390952
//https://greasyfork.org/zh-CN/scripts/398195
//默认自动解析接口序号,可自定义修改顺序
const defaultVipInterfaceIndex = 3;
//默认VIP解析接口
const originalInterfaceList = [
{ "name": "纯净/B站", "category": 1, "url": "https://z1.m1907.cn/?jx=", "showType": 3 },
{ "name": "高速接口", "category": 1, "url": "https://jsap.attakids.com/?url=", "showType": 3 },
{ "name": "综合/B站1", "category": 1, "url": "https://vip.parwix.com:4433/player/?url=", "showType": 3 },
{ "name": "OK解析", "category": 1, "url": "https://okjx.cc/?url=", "showType": 3 },
{ "name": "夜幕", "category": 1, "url": "https://www.yemu.xyz/?url=", "showType": 3 },
{ "name": "乐多资源", "category": 1, "url": "https://api.leduotv.com/wp-api/ifr.php?isDp=1&vid=", "showType": 3 },
{ "name": "虾米", "category": 1, "url": "https://jx.xmflv.com/?url=", "showType": 3 },
{ "name": "M3U8.TV", "category": 1, "url": "https://jx.m3u8.tv/jiexi/?url=", "showType": 3 },
{ "name": "人人迷", "category": 1, "url": "https://jx.blbo.cc:4433/?url=", "showType": 3 },
{ "name": "全民", "category": 1, "url": "https://jx.blbo.cc:4433/?url=", "showType": 3 },
{ "name": "七哥", "category": 1, "url": "https://jx.mmkv.cn/tv.php?url=", "showType": 3 },
{ "name": "冰豆", "category": 1, "url": "https://api.qianqi.net/vip/?url=", "showType": 3 },
{ "name": "迪奥", "category": 1, "url": "https://123.1dior.cn/?url=", "showType": 3 },
{ "name": "CK", "category": 1, "url": "https://www.ckplayer.vip/jiexi/?url=", "showType": 3 },
{ "name": "游艺", "category": 1, "url": "https://api.u1o.net/?url=", "showType": 3 },
{ "name": "LE", "category": 1, "url": "https://lecurl.cn/?url=", "showType": 3 },
{ "name": "ckmov", "category": 1, "url": "https://www.ckmov.vip/api.php?url=", "showType": 3 },
{ "name": "ccyjjd", "category": 1, "url": "https://ckmov.ccyjjd.com/ckmov/?url=", "showType": 3 },
{ "name": "爱豆", "category": 1, "url": "https://jx.aidouer.net/?url=", "showType": 3 },
{ "name": "诺诺", "category": 1, "url": "https://www.ckmov.com/?url=", "showType": 3 },
{ "name": "H8", "category": 1, "url": "https://www.h8jx.com/jiexi.php?url=", "showType": 3 },
{ "name": "BL", "category": 1, "url": "https://vip.bljiex.com/?v=", "showType": 3 },
{ "name": "解析la", "category": 1, "url": "https://api.jiexi.la/?url=", "showType": 3 },
{ "name": "MUTV", "category": 1, "url": "https://jiexi.janan.net/jiexi/?url=", "showType": 3 },
{ "name": "MAO", "category": 1, "url": "https://www.mtosz.com/m3u8.php?url=", "showType": 3 },
{ "name": "老板", "category": 1, "url": "https://vip.laobandq.com/jiexi.php?url=", "showType": 3 },
{ "name": "盘古", "category": 1, "url": "https://www.pangujiexi.cc/jiexi.php?url=", "showType": 3 },
{ "name": "盖世", "category": 1, "url": "https://www.gai4.com/?url=", "showType": 3 },
{ "name": "小蒋", "category": 1, "url": "https://www.kpezp.cn/jlexi.php?url=", "showType": 3 },
{ "name": "YiTV", "category": 1, "url": "https://jiexi.us/?url=", "showType": 3 },
{ "name": "星空", "category": 1, "url": "http://60jx.com/?url=", "showType": 1 },
{ "name": "0523", "category": 1, "url": "https://go.yh0523.cn/y.cy?url=", "showType": 1 },
{ "name": "17云", "category": 1, "url": "https://www.1717yun.com/jx/ty.php?url=", "showType": 1 },
{ "name": "4K", "category": 1, "url": "https://jx.4kdv.com/?url=", "showType": 1 },
{ "name": "云析", "category": 1, "url": "https://jx.yparse.com/index.php?url=", "showType": 1 },
{ "name": "8090", "category": 1, "url": "https://www.8090g.cn/?url=", "showType": 1 },
{ "name": "江湖", "category": 1, "url": "https://api.jhdyw.vip/?url=", "showType": 1 },
{ "name": "诺讯", "category": 1, "url": "https://www.nxflv.com/?url=", "showType": 1 },
{ "name": "PM", "category": 1, "url": "https://www.playm3u8.cn/jiexi.php?url=", "showType": 1 },
{ "name": "奇米", "category": 1, "url": "https://qimihe.com/?url=", "showType": 1 },
{ "name": "思云", "category": 1, "url": "https://jx.ap2p.cn/?url=", "showType": 1 },
{ "name": "听乐", "category": 1, "url": "https://jx.dj6u.com/?url=", "showType": 1 },
{ "name": "aijx", "category": 1, "url": "https://jiexi.t7g.cn/?url=", "showType": 1 },
{ "name": "52", "category": 1, "url": "https://vip.52jiexi.top/?url=", "showType": 1 },
{ "name": "黑米", "category": 1, "url": "https://www.myxin.top/jx/api/?url=", "showType": 1 },
{ "name": "豪华啦", "category": 1, "url": "https://api.lhh.la/vip/?url=", "showType": 1 },
{ "name": "凉城", "category": 1, "url": "https://jx.mw0.cc/?url=", "showType": 1 },
{ "name": "33t", "category": 1, "url": "https://www.33tn.cn/?url=", "showType": 1 },
{ "name": "180", "category": 1, "url": "https://jx.000180.top/jx/?url=", "showType": 1 },
{ "name": "无名", "category": 1, "url": "https://www.administratorw.com/video.php?url=", "showType": 1 },
{ "name": "黑云", "category": 1, "url": "https://jiexi.380k.com/?url=", "showType": 1 },
{ "name": "九八", "category": 1, "url": "https://jx.youyitv.com/?url=", "showType": 1 },
{ "name": "综合线路解析", "category": 2, "url": "https://www.xixicai.top/mov/s/?sv=3&url=", "showType": 1 },
{ "name": "纯净/B站", "category": 2, "url": "https://z1.m1907.cn/?jx=", "showType": 1 },
{ "name": "高速接口", "category": 2, "url": "https://jsap.attakids.com/?url=", "showType": 1 },
{ "name": "综合/B站1", "category": 2, "url": "https://vip.parwix.com:4433/player/?url=", "showType": 1 },
{ "name": "OK解析", "category": 2, "url": "https://okjx.cc/?url=", "showType": 1 },
{ "name": "夜幕", "category": 2, "url": "https://www.yemu.xyz/?url=", "showType": 1 },
{ "name": "虾米", "category": 2, "url": "https://jx.xmflv.com/?url=", "showType": 1 },
{ "name": "全民", "category": 2, "url": "https://jx.quanmingjiexi.com/?url=", "showType": 1 },
];
//自定义接口和默认接口绑定
let newOriginalInterfaceList = originalInterfaceList;
try {
newOriginalInterfaceList = customizeInterfaceList.concat(originalInterfaceList);
} catch (e) {
console.log("自定义解析接口错误,注意数据格式....");
}
/**
* 共有方法,全局共享
*/
function commonFunction() {
this.GMgetValue = function (name, value) { //得到存在本地的数据
if (typeof GM_getValue === "function") {
return GM_getValue(name, value);
} else {
return GM.getValue(name, value);
}
};
this.GMsetValue = function (name, value) {
if (typeof GM_setValue === "function") {
return GM_setValue(name, value);
} else {
return GM.setValue(name, value);
}
};
this.GMaddStyle = function (css) {
var myStyle = document.createElement('style');
myStyle.textContent = css;
var doc = document.head || document.documentElement;
doc.appendChild(myStyle);
};
this.GMopenInTab = function (url, open_in_background) {
if (typeof GM_openInTab === "function") {
GM_openInTab(url, open_in_background);
} else {
GM.openInTab(url, open_in_background);
}
};
this.addScript = function (url) {
var s = document.createElement('script');
s.setAttribute('src', url);
document.body.appendChild(s);
};
this.randomNumber = function () {
return Math.ceil(Math.random() * 100000000);
};
this.request = function (mothed, url, param) { //网络请求
return new Promise(function (resolve, reject) {
GM_xmlhttpRequest({
url: url,
method: mothed,
data: param,
onload: function (response) {
var status = response.status;
var playurl = "";
if (status == 200 || status == '200') {
var responseText = response.responseText;
resolve({ "result": "success", "data": responseText });
} else {
reject({ "result": "error", "data": null });
}
}
});
})
};
this.addCommonHtmlCss = function () {
var cssText =
`
@keyframes fadeIn {
0% {opacity: 0}
100% {opacity: 1}
}
@-webkit-keyframes fadeIn {
0% {opacity: 0}
100% {opacity: 1}
}
@-moz-keyframes fadeIn {
0% {opacity: 0}
100% {opacity: 1}
}
@-o-keyframes fadeIn {
0% {opacity: 0}
100% {opacity: 1}
}
@-ms-keyframes fadeIn {
0% {opacity: 0}
100% {opacity: 1}
}
@keyframes fadeOut {
0% {opacity: 1}
100% {opacity: 0}
}
@-webkit-keyframes fadeOut {
0% {opacity: 1}
100% {opacity: 0}
}
@-moz-keyframes fadeOut {
0% {opacity: 1}
100% {opacity: 0}
}
@-o-keyframes fadeOut {
0% {opacity: 1}
100% {opacity: 0}
}
@-ms-keyframes fadeOut {
0% {opacity: 1}
100% {opacity: 0}
}
.web-toast-kkli9{
position: fixed;
background: rgba(0, 0, 0, 0.7);
color: #fff;
font-size: 14px;
line-height: 1;
padding:10px;
border-radius: 3px;
left: 50%;
transform: translateX(-50%);
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-o-transform: translateX(-50%);
-ms-transform: translateX(-50%);
z-index: 9999;
white-space: nowrap;
}
.fadeOut{
animation: fadeOut .5s;
}
.fadeIn{
animation:fadeIn .5s;
}
`;
this.GMaddStyle(cssText);
};
this.webToast = function (params) { //小提示框
var time = params.time;
var background = params.background;
var color = params.color;
var position = params.position; //center-top, center-bottom
var defaultMarginValue = 50;
if (time == undefined || time == '') {
time = 1500;
}
var el = document.createElement("div");
el.setAttribute("class", "web-toast-kkli9");
el.innerHTML = params.message;
//背景颜色
if (background == undefined || background == '') {
el.style.backgroundColor = background;
}
//字体颜色
if (color == undefined || color == '') {
el.style.color = color;
}
//显示位置
if (position == undefined || position == '') {
position = "center-bottom";
}
//设置显示位置,当前有种两种形式
if (position === "center-bottom") {
el.style.bottom = defaultMarginValue + "px";
} else {
el.style.top = defaultMarginValue + "px";
}
el.style.zIndex = 999999;
document.body.appendChild(el);
el.classList.add("fadeIn");
setTimeout(function () {
el.classList.remove("fadeIn");
el.classList.add("fadeOut");
/*监听动画结束,移除提示信息元素*/
el.addEventListener("animationend", function () {
document.body.removeChild(el);
});
el.addEventListener("webkitAnimationEnd", function () {
document.body.removeChild(el);
});
}, time);
},
this.queryUrlParamter = function (text, tag) { //查询GET请求url中的参数
if (text.indexOf("?") != -1) { //选取?后面的字符串,兼容window.location.search,前面的?不能去掉
var textArray = text.split("?");
text = "?" + textArray[textArray.length - 1];
}
var t = new RegExp("(^|&)" + tag + "=([^&]*)(&|$)");
var a = text.substr(1).match(t);
if (a != null) {
return a[2];
}
return "";
};
this.isPC = function () {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
};
}
const commonFunctionObject = new commonFunction(); //全局统一变量
commonFunctionObject.addCommonHtmlCss(); //统一html、css元素添加
/**
* 超级解析助手
* @param {Object} originalInterfaceList
* @param {Object} playerNodes
*/
function superVideoHelper(originalInterfaceList) {
this.originalInterfaceList = originalInterfaceList;
this.checkbox_true_image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA2tJREFUaEPtmkvoTV0Yxn/PUCZiRPK5DQ1IzHwToUxIriW55FoGRMiEci+XgVyj3HKPzy2RFEqJUAYShUgpvpJSUq9erfPv2J2999r7f5yzyapzdqf9Xp5nvWu96z1rLZFoZtYbGAUMD88BSZkW/34BXAfu+VPSm3r/qv9hZtuAGUCPFoOMdfcBOCxpaU2hg4CZWayVKshJ+oH9x5eZTQWOVwFYAQzTJJ2QmXUHHgB9CyhXQfQlMNQJzAP2VgFRCQzzncARYHoJ5SqoHHUCHop/qoCmBIZXTuC3yj5Jkn8JlA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1z6ILseRDS94/q0nAzM6AC2AN2FywSx3gF2hKug97GXLAzK6B+oKbHjd9XVKj+OMAATPbA94r2nze1r6kj/xLSKANHFScwKukw3EEfoD1gMAD8Ah8lUxsGzgFjoN5u5I2xhGw4OE3SQt1xMyeQxKS+isnXEIhgaFNU7ILmFnmQEaiP6YhUJPUKrvpcD4zGxA2ESjbkeRA2YqnPVBQIL2FPJZf2sQeKsZgJAdi1POoTQ54qBiDkRyIUc+jNjngoWIMRnIgRj2P2uSAh4oxGMmBGPU8apMDHirGYCQHYtTzqI1x4FJS06OJWTHM7AR4KtZPczbaklSbdXKPOjP7BHYmJfA9ItTLTqcbZZ9Sm9kucAtkn8XRkbSV3wjzgRegH994KDgHjLako3EEsnj1bg6TekKeF+PW1YpZc5l6cetNL/ALQz9PNSfB6gLZdVWMV0cuoUnQqvbMav5Xomoq/9fPH0I4X0Cu+FOiAAAAAElFTkSuQmCC";
this.elementId = Math.ceil(Math.random() * 100000000) + "mmx";
this.autoPlayerSaveKey = "autolayed_isopen_" + window.location.host; //自动播放开启标识
this.playerNodes = [
{ url: "v.qq.com", node: "#mod_player" },
{ url: "www.iqiyi.com", node: "#flashbox" },
{ url: "v.youku.com", node: "#player" },
{ url: "w.mgtv.com", node: "#mgtv-player-wrap" },
{ url: "www.mgtv.com", node: "#mgtv-player-wrap" },
{ url: "tv.sohu.com", node: "#player" },
{ url: "film.sohu.com", node: "#playerWrap" },
{ url: "www.le.com", node: "#le_playbox" },
{ url: "video.tudou.com", node: ".td-playbox" },
{ url: "v.pptv.com", node: "#pptv_playpage_box" },
{ url: "vip.pptv.com", node: ".w-video" },
{ url: "www.wasu.cn", node: "#flashContent" },
{ url: "www.acfun.cn", node: "#player" },
{ url: "www.bilibili.com", node: "#player_module" },
{ url: "vip.1905.com", node: "#player" },
];
this.isRun = function () { //判断是否运行
const host = window.location.host;
const urls = ["www.iqiyi.com", "v.qq.com", "youku.com", "www.le.com", "mgtv.com", "sohu.com", "acfun.cn", "bilibili.com", "baofeng.com", "pptv.com"];
var result = false;
if (!host.startsWith("m.")) { //不是移动端执行
for (var i = 0; i < urls.length; i++) { //不是B站直接判断
if (window.location.host.indexOf("bilibili.com") == -1) {
if (window.location.host.indexOf(urls[i]) != -1) {
result = true;
break;
}
} else {
if (window.location.href.indexOf("www.bilibili.com/bangumi/play") != -1) { //是B站只有番剧才开启VIP解析
result = true;
break;
}
}
}
}
return result;
};
this.showPlayerWindow = function (playObject) { //显示播放窗口
var node = null;
for (var i in this.playerNodes) { //获得窗口ID
if (this.playerNodes[i].url == window.location.host) {
node = this.playerNodes[i].node;
break;
}
}
if (!node) {
console.log("播放node查找失败....");
return;
}
$("#ddddd12235500kknnn").remove();
var url = playObject.url + window.location.href;
var videoPlayer = "<div style='width:100%;height:100%;z-index:1000;' id='ddddd12235500kknnn'><iframe id='iframe-player-99087lkj' src='" + url + "' frameborder='0' allowfullscreen='true' width='100%' height='100%'></iframe></div>";
var category = playObject.category;
if (category == 1) { //内嵌播放....
var $player = $(node);
$player.empty();
$player.html(videoPlayer);
}
if (category == 2) { //弹窗播放....
commonFunctionObject.GMopenInTab(url, false);
}
};
this.addHtmlElements = function () { //添加HTML
const vipVideoImageBase64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAC9klEQVRoQ+2ZPWgVQRDH/7/CWqOIYOFHFbRSjJhGMGDpByoIago70cqvUtQgdipWFqawMWghGIidhcHKQAJqEURBRfED1CCCjc3IPu4em31775J7d3m8cAtX3O7szP7nPzszx6EeH/T4+VUD6DaDTQbMbE+3D7MY+8Ckkw8BPFuMki7KDtUAuuh9Z3oZMtBljxY2X9eBwq4raWPNQEmOLKxm+TBgZqsknQ1dAVzNco+ZhWsm6ZakHZLC1mQyrZ5OX2RvzMxnSa8lzQJ/YwLzGDCze5JOeoI/gbVtAMxJ6vPW7wKnkr4qbEuaxccDcGWBsfNV0mjMmSGAg5LGA6XbgFehITPbLel5MN84ZAUAUjMPgWO+zZ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pM8YZSOTgLpMqnThMEbXVXxfhhzZMdDBBKJusk7VHvdodKdB39fy2MPybMjuxcmkEiUneOs30R84PyBI9rBcMpyOYClFXDrDBU52XgvAonEqE9Mu53uVp+YLHYqgFPS4/r2vJbVbY02Yx/iJsEpfORz49jge3e/e+9AFWaddtiHnermbl7EdT3HDYPt7jaMA3xsFxpxc7qrZ/c4vfoqaRGn6Pn5LFVVX0eZThxGhzA0LR0TudC0QPXRO+8J/AOnYvFAtGhKvAAAAABJRU5ErkJggg==";
const currentHost = window.location.host;
var category_1_html = "";
var category_2_html = "";
this.originalInterfaceList.forEach((item, index) => {
if (item.showType != 2) {
if (item.category == 1) {
category_1_html += "<span title='" + item.name + "' data-index='" + index + "'>" + item.name + "</span>";
}
if (item.category == 2) {
category_2_html += "<span title='" + item.name + "' data-index='" + index + "'>" + item.name + "</span>";
}
}
});
//获得自定义位置
var left = 0;
var top = 120;
var Position = commonFunctionObject.GMgetValue("Position_" + currentHost);
if (!!Position) {
left = Position.left;
top = Position.top;
}
var color = "#FF4D40";
var hoverColor = "#000000";
if (currentHost.indexOf("bilibili.com") != -1) { //自定义主题
color = "#fb7299";
hoverColor = "#00B0E1";
}
var cssMould = `#vip_movie_box` + this.elementId + `{cursor:pointer; position:fixed; top:` + top + `px; left:` + left + `px; width:0px; z-index:99999999; font-size:16px; text-align:left;}
#vip_movie_box`+ this.elementId + ` .img_box` + this.elementId + `{width:26px; height:32px;line-height:32px;text-align:center;background-color:` + color + `;}
#vip_movie_box`+ this.elementId + ` .img_box` + this.elementId + `>img {width:20px; display:inline-block; vertical-align:middle;}
#vip_movie_box`+ this.elementId + ` .showhide_box` + this.elementId + `{display:none;padding-left:5px;position: absolute;left: 26px;top: 0;}
#vip_movie_box`+ this.elementId + ` .vip_mod_box_action_687ii{width:380px; max-height:400px; overflow-y:auto;background-color:rgba(241,241,241);}
#vip_movie_box`+ this.elementId + ` .default-scrollbar-55678::-webkit-scrollbar{width:5px; height:1px;}
#vip_movie_box`+ this.elementId + ` .default-scrollbar-55678::-webkit-scrollbar-thumb{box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.2); background:#A8A8A8;}
#vip_movie_box`+ this.elementId + ` .default-scrollbar-55678::-webkit-scrollbar-track{box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.2); background:#F1F1F1;}
#vip_movie_box`+ this.elementId + ` .vip_mod_box_action_687ii> .item_box` + this.elementId + `{margin-bottom:10px;}
#vip_movie_box`+ this.elementId + ` .vip_mod_box_action_687ii> .item_box` + this.elementId + `:last-child{margin-bottom:0px;}
#vip_movie_box`+ this.elementId + ` .vip_mod_box_action_687ii> .item_box` + this.elementId + ` >.title` + this.elementId + `{font-size:14px; text-align:left;color:#000000;font-weight:600;margin:5px 3px;}
#vip_movie_box`+ this.elementId + ` .vip_mod_box_action_687ii> .item_box` + this.elementId + ` >.interface_box` + this.elementId + `{}
#vip_movie_box`+ this.elementId + ` .vip_mod_box_action_687ii> .item_box` + this.elementId + ` >.interface_box` + this.elementId + `>span{border-radius:3px;border-top:3px solid ` + color + `; border-bottom:3px solid ` + color + `;display:inline-block;width:calc(25% - 6px);width:-moz-calc(25% - 6px);width: -webkit-calc(25% - 6px);height:20px;line-height:20px;background-color:` + color + `;color:#FFF;cursor:pointer;margin:3px;text-align:center;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;-o-text-overflow:ellipsis;font-size:12px!important;}
#vip_movie_box`+ this.elementId + ` .vip_mod_box_action_687ii> .item_box` + this.elementId + ` >.interface_box` + this.elementId + `>span:hover{border-top:3px solid ` + hoverColor + `; border-bottom:3px solid ` + hoverColor + `;}
#vip_movie_box`+ this.elementId + ` .vip_mod_box_action_687ii> .item_box` + this.elementId + ` >.interface_box` + this.elementId + `>span.selected{border-top:3px solid ` + hoverColor + `; border-bottom:3px solid ` + hoverColor + `;}
#vip_movie_box`+ this.elementId + ` .vip_mod_box_action_687ii> .item_box` + this.elementId + ` >.content` + this.elementId + `{font-size:12px;color:#000000;margin-left:3px;}
`
commonFunctionObject.GMaddStyle(cssMould);
//判断自动解析状态
var checkboxImage = "";
if (!!commonFunctionObject.GMgetValue(this.autoPlayerSaveKey, null)) {
checkboxImage = this.checkbox_true_image;
} else {
checkboxImage = this.checkbox_false_image;
}
//加入HTML
var htmlMould = `<div id='vip_movie_box` + this.elementId + `'>
<div class='plugin_inner_`+ this.elementId + `'>
<div class="img_box`+ this.elementId + `" id="img_box_jump_6667897iio"><img src='` + vipVideoImageBase64 + `' title='选择解析线路'/></div>
<div class='showhide_box`+ this.elementId + `'>
<div class='vip_mod_box_action_687ii default-scrollbar-55678'>
<div class='item_box`+ this.elementId + `'>
<div class='title`+ this.elementId + `'><b>全网VIP视频解析[内嵌播放]</b></div>
<div class='interface_box`+ this.elementId + `'>
` + category_1_html + `
</div>
</div>
<div class='item_box`+ this.elementId + `'>
<div class='title`+ this.elementId + `'><b>全网VIP视频解析[弹窗播放]</b></div>
<div class='interface_box`+ this.elementId + `'>
` + category_2_html + `
</div>
</div>
<div class='item_box`+ this.elementId + `'>
<div class='title`+ this.elementId + `'><b>自动解析说明:</b></div>
<div class='content`+ this.elementId + `'>
1、开启自动开启后,网页打开2S后脚本将自动解析视频。如果自动解析失败,请手动选择不同的解析接口尝试。(PS:解析接口有些视频没资源,这个也没办法)
<br>2、<span style="color:red;">如果某些网站有会员可以关闭解析,关闭功能相互独立,互不影响</span>
<br>3、自动解析默认关闭
<br>4、当前使用的是第`+ defaultVipInterfaceIndex + `个接口作为自动解析默认接口,往后版本将加入自定义自动解析接口
</div>
</div>
</div>
</div>
</div>
<div class="img_box`+ this.elementId + `" id="img_box_6667897iio"><img src='` + checkboxImage + `' title='是否打开自动解析。若自动解析失败,请手动选择其它接口尝试!!'/></div>
</div>
`;
$("body").append(htmlMould);
};
this.removePlatformVipMod = function () { //移除平台vip弹框提醒
let host = window.location.host;
setInterval(function () {
if (host.indexOf("v.qq.com") != -1) {
$("#mask_layer").hide();
$(".mod_vip_popup").hide();
}
}, 200);
};
this.autoPlayerEvent = function () { //自动播放事件
let delayTimeMs = 2500;
if (window.location.host === "v.qq.com") delayTimeMs = 4000;
if (commonFunctionObject.GMgetValue(this.autoPlayerSaveKey, null) === "true") {
commonFunctionObject.webToast({ "message": "自动解析准备中", "background": "#FFFFFF", "time": delayTimeMs - 400 });
setTimeout(() => {
this.showPlayerWindow(this.originalInterfaceList[defaultVipInterfaceIndex - 1]);
commonFunctionObject.webToast({ "message": "自动解析成功", "background": "#FFFFFF" });
}, delayTimeMs);
}
};
this.runEvent = function () { //事件运行
var that = this;
$("#vip_movie_box" + this.elementId + " >.plugin_inner_" + this.elementId).on("mouseover", () => {
$(".showhide_box" + this.elementId).show();
});
$("#vip_movie_box" + this.elementId + " >.plugin_inner_" + this.elementId).on("mouseout", () => {
$(".showhide_box" + this.elementId).hide();
});
$("body").on("click", "#vip_movie_box" + this.elementId + " .vip_mod_box_action_687ii>.item_box" + this.elementId + ">.interface_box" + this.elementId + ">span", function () {
var index = parseInt($(this).attr("data-index"));
var playObject = that.originalInterfaceList[index];
that.showPlayerWindow(playObject);
$("#vip_movie_box" + that.elementId + " .vip_mod_box_action_687ii> .item_box" + that.elementId + ">.interface_box" + that.elementId + ">span").removeClass("selected");
$(this).addClass("selected");
});
//补充事件
this.removePlatformVipMod(); //移除平台VIP提醒
this.autoPlayerEvent(); //自动解析播放限制
//点击视频播放界面
$("#img_box_jump_6667897iio").on("click", function () {
commonFunctionObject.GMopenInTab("https://www.xixicai.top/mov/s/?sv=3&url=" + window.location.href, false);
});
//点击切换是否自动解析
$("#img_box_6667897iio").on("click", function () {
var $image = $(this).find("img");
var autoPlayerSaveKey = that.autoPlayerSaveKey;
if (commonFunctionObject.GMgetValue(autoPlayerSaveKey, null) === "true") {
commonFunctionObject.GMsetValue(autoPlayerSaveKey, null);
commonFunctionObject.webToast({ "message": "自动解析:关闭", "background": "#FFE009" });
$image.attr("src", that.checkbox_false_image);
} else {
commonFunctionObject.GMsetValue(autoPlayerSaveKey, "true");
commonFunctionObject.webToast({ "message": "自动解析:打开", "background": "#FFE009" });
$image.attr("src", that.checkbox_true_image);
}
});
//右键移动位置
var movie_box = $("#vip_movie_box" + this.elementId);
movie_box.mousedown(function (e) {
if (e.which == 3) {
e.preventDefault()
movie_box.css("cursor", "move");
var positionDiv = $(this).offset();
var distenceX = e.pageX - positionDiv.left;
var distenceY = e.pageY - positionDiv.top;
$(document).mousemove(function (e) {
var x = e.pageX - distenceX;
var y = e.pageY - distenceY;
var windowWidth = $(window).width();
var windowHeight = $(window).height();
if (x < 0) {
x = 0;
} else if (x > windowWidth - movie_box.outerWidth(true) - 100) {
x = windowWidth - movie_box.outerWidth(true) - 100;
}
if (y < 0) {
y = 0;
} else if (y > windowHeight - movie_box.outerHeight(true)) {
y = windowHeight - movie_box.outerHeight(true);
}
movie_box.css("left", x);
movie_box.css("top", y);
commonFunctionObject.GMsetValue("Position_" + window.location.host, { "left": x, "top": y });
});
$(document).mouseup(function () {
$(document).off('mousemove');
movie_box.css("cursor", "pointer");
});
$(document).contextmenu(function (e) {
e.preventDefault();
})
}
});
};
this.removeVideoAdBlock_iqiyi = function () {
},
this.removeVideoAdBlock_vqq = function () {
},
this.removeVideoAdBlock_youku = function () {
},
this.removeVideoAdBlock_mgtv = function () {
},
this.removeVideoAdBlock_sohu = function () {
},
this.removeVideoAdBlock = function () {
//如果开启了自动解析,则关闭去广告
if (commonFunctionObject.GMgetValue(this.autoPlayerSaveKey, null) === "true") {
return;
}
const currentHost = window.location.host;
if (currentHost.indexOf("www.iqiyi.com") != -1) {
this.removeVideoAdBlock_iqiyi();
} else if (currentHost.indexOf("v.qq.com") != -1) {
this.removeVideoAdBlock_vqq();
} else if (currentHost.indexOf("v.youku.com") != -1) {
this.removeVideoAdBlock_youku();
} else if (currentHost.indexOf("www.mgtv.com") != -1) {
this.removeVideoAdBlock_mgtv();
} else if (currentHost.indexOf("tv.sohu.com") != -1) {
this.removeVideoAdBlock_sohu();
}
};
//借鉴脚本作者:lanhaha , 版权归原作者所有
//地址:https://greasyfork.org/zh-CN/scripts/370634
//修改:优化了该段代码的逻辑,添加新功能,使可读性更高
this.pageEventExtend = function () {
const window_url = window.location.href;
if (window_url.indexOf('v.qq.com/x/cover') != -1) {
$("body").on('mouseover', '.item a', function (e) {
let $playerItem = $(this), href = $playerItem.attr('href') || $playerItem.data("href");
$playerItem.off('click.chrome');
$playerItem.on('click.chrome', function () {
window.location.href = href
}).attr('data-href', href).css({
cursor: 'pointer'
}).removeAttr('href')
});
} else if (window_url.indexOf('iqiyi.com/v_') != -1) {
function remove(selector) {
if (!document.querySelectorAll) {
return;
}
var nodes = document.querySelectorAll(selector);
if (nodes) {
for (var i = 0; i < nodes.length; i++) {
if (nodes[i] && nodes[i].parentNode) {
nodes[i].parentNode.removeChild(nodes[i]);
}
}
}
};
function removeObj(targetSelector, rootSelector = 'body', wait) {
const rootElement = document.querySelector(rootSelector);
const targetElement = rootElement.querySelector(targetSelector);
if (targetElement) {
return Promise.resolve(targetElement)
}
return new Promise((resolve, reject) => {
const callback = function (matationList, observer) {
const targetElement = rootElement.querySelector(targetSelector);
if (targetElement) {
resolve(targetElement);
observer.disconnect()
}
};
const observer = new MutationObserver(callback);
observer.observe(rootElement, {
subtree: true,
childList: true
});
if (wait !== undefined) {
setTimeout(() => {
observer.disconnect()
}, wait)
}
})
};
async function removeAll(targetSelector, rootSelector, now = false) {
if (now) {
const parent = rootSelector ? document.querySelector(rootSelector) : document;
if (parent) {
const target = parent.querySelector(targetSelector);
if (target) {
target.remove();
return true
}
}
return false
}
const target = await removeObj(targetSelector, rootSelector);
target.remove()
};
setTimeout(() => {
remove('div#scrollTip,.qy-glide,#qy-glide,[class^="qy-glide"],[id^="qy-glide"],svg[display="none"][aria-hidden="true"],div[class*="player-side-ear"],div[class^="player-mnb"][data-asyn-pb]');
removeAll('div[style*="visibility"][style*="visible"]:not([class]):not([id]):not([style*="fixed"])', undefined, false);
}, 1000);
$('div[style*="visibility"][style*="visible"]:not([class]):not([id]):not([style*="fixed"])').hide();
$("body").on('mouseover', 'ul li [href*="/v_"][href*=".html"]:not([href*="=http"]):not([href*="?http"]):not([href*="#http"])', function (e) {
let $playerItem = $(this), href = $playerItem.attr('href') || $playerItem.data("href");
$playerItem.off('click.chrome');
$playerItem.on('click.chrome', function () {
window.location.href = href
}).attr('data-href', href).css({
cursor: 'pointer'
}).removeAttr('href');
});
} else if (window_url.indexOf('bilibili.com/bangumi/') != -1) {
$("body").on('mouseover', '.ep-item a', function (e) {
let $playerItem = $(this), href = $playerItem.attr('href') || $playerItem.data("href");
$playerItem.off('click.chrome');
$playerItem.on('click.chrome', function () {
window.location.href = href
}).attr('data-href', href).css({
cursor: 'pointer'
}).removeAttr('href');
})
}
};
this.start = function () {
if (this.isRun()) {
try {
this.pageEventExtend();
} catch (e) { }
let delayTimeMs = 0;
if (window.location.host.indexOf("www.bilibili.com") != -1) {
delayTimeMs = 2000;
} else {
delayTimeMs = 1800;
}
setTimeout(() => {
try {
this.removeVideoAdBlock();
} catch (e) { }
try {
this.addHtmlElements();
this.runEvent();
} catch (e) { }
}, delayTimeMs);
}
};
};
/**
* 移动端VIP解析
* @param {Object} originalInterfaceList
*/
function superVideoHelperMobile(originalInterfaceList) {
this.originalInterfaceList = originalInterfaceList;
this.elementId = Math.ceil(Math.random() * 100000000) + "mmx";
this.playerNodes = [
{ "url": "m.iqiyi.com", "node": ".m-video-player-wrap", "color": "#05B03B" },
{ "url": "m.v.qq.com", "node": ".mod_player", "color": "#F99D39" },
{ "url": "m.youku.com", "node": ".h5-detail-player", "color": "#08BAFD" },
{ "url": "m.mgtv.com", "node": ".video-area", "color": "#E95904" },
];
this.isRun = function () { //判断是否运行
const host = window.location.host;
const urls = ["m.iqiyi.com", "m.v.qq.com", "m.youku.com", "m.mgtv.com"];
var result = false;
if (host.startsWith("m.")) { //是移动端执行
for (var i = 0; i < urls.length; i++) {
if (host.indexOf(urls[i]) != -1) {
result = true;
break;
}
}
}
return result;
};
this.getwindowElement = function () {
var nodeObject = null;
for (var i in this.playerNodes) { //获得窗口ID
if (this.playerNodes[i].url == window.location.host) {
nodeObject = this.playerNodes[i];
break;
}
}
return nodeObject;
};
this.addHtmlElements = function () {
let nodeObject = this.getwindowElement();
if (!nodeObject) return;
return new Promise((resolve, reject) => {
const elementInterval = setInterval(() => {
const nodeElementObject = $(nodeObject.node), themeColor = nodeObject.color;
if (nodeElementObject.length == 0) return;
clearInterval(elementInterval);
//添加HTML
var cssMould = `
#open_modal_warp_`+ this.elementId + `{
margin:15px;
padding:5px 0px;
text-align:center;
background-color:`+ themeColor + `;
border-radius:4px;
cursor:pointer;
z-index: 999999999999999999999;
}
#open_modal_warp_`+ this.elementId + `>div{
color:#FFF;
}
#open_modal_warp_`+ this.elementId + `>div:nth-child(1){
font-size:14px;
font-weight:700;
padding:0px;
margin:0px;
}
#open_modal_warp_`+ this.elementId + `>div:nth-child(2){
font-size:10px;
margin-top:5px;
}
#select_interface_modal_warp_`+ this.elementId + `{
position: fixed;
top: 100px;
background-color: #FFF;
z-index: 999999999999999999999;
left: 15px;
right: 15px;
display:none;
padding:10px;
border-radius: 3px;
background-color:#FFFAE8;
}
#select_interface_modal_warp_`+ this.elementId + `>div{
width:100%;
}
#select_interface_modal_warp_`+ this.elementId + `>div:nth-child(1) >span{
display: inline-block;
background: `+ themeColor + `;
margin-right: 8px;
height: 10px;
width: calc(100% * (1/4) - 6px);
height: 24px;
line-height: 24px;
text-align: center;
margin-top: 10px;
font-size: 12px;
border-radius: 3px;
color: #FFF;
position:relative;
}
#select_interface_modal_warp_`+ this.elementId + `>div:nth-child(1) >span:nth-child(4n){
margin-right:0px;
}
#select_interface_modal_warp_`+ this.elementId + `>div:nth-child(1) >span.item{
}
#select_interface_modal_warp_`+ this.elementId + `>div:nth-child(1) >span.item-active:after{
position: absolute;
content: " ";
height: 2px;
width: 50%;
background-color: #FFF;
bottom: 2px;
left: 50%;
transform: translateX(-50%);
}
#select_interface_modal_warp_`+ this.elementId + `>div:nth-child(2){
text-align:center;
margin-top:15px;
}
#select_interface_modal_warp_`+ this.elementId + `>div:nth-child(2) >span.close_modal_btn{
display:inline-block;
padding:4px 5px;
border-radius:3px;
background-color:#E9DFC4;
color:#000;
font-size: 12px;
}
`
commonFunctionObject.GMaddStyle(cssMould);
//添加HTML
let category_1_html = "";
this.originalInterfaceList.forEach((item, index) => {
if (item.showType != 1 && item.category == 1) {
category_1_html += "<span class='item' title='" + item.name + "' data-index='" + index + "'>" + item.name + "</span>";
}
});
var htmlMould = `
<div id="open_modal_warp_`+ this.elementId + `">
<div>点击选择解析接口</div>
<div>(请不要相信解析视频中的任何广告,有问题请到Greasyfork反馈)</div>
</div>
<div id="select_interface_modal_warp_`+ this.elementId + `">
<div>
`+ category_1_html + `
</div>
<div>
<span class="close_modal_btn">关闭弹框</span>
</div>
</div>
`;
$("div[id^='open_modal_warp_']").remove();
nodeElementObject.after(htmlMould);
resolve("ok");
}, 100);
});
};
this.runEvent = function () { //事件运行
const self = this;
$("body").on("touchstart", "#open_modal_warp_" + this.elementId, function () {