-
Notifications
You must be signed in to change notification settings - Fork 92
/
我是网盘管家婆 .user.js
2207 lines (2068 loc) · 92.3 KB
/
我是网盘管家婆 .user.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 我是网盘管家婆
// @namespace http://tampermonkey.net/
// @version 0.6.4
// @description 支持网盘:【百度.蓝奏.天翼.阿里.迅雷.微云.彩云.夸克.123盘】 功能概述:【网盘页面增加资源搜索快捷方式,访问过的分享链接和密码自动记忆,本地缓存数据库搜索】
// @antifeature tracking 若密码忘记,从云端查询,有异议请不要安装
// @author 管家婆
// @match *://*/*
// @icon https://img1.baidu.com/it/u=2180966356,3803679341&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=375
// @connect baidu.com
// @connect fryaisjx.lc-cn-n1-shared.com
// @require https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_deleteValue
// ==/UserScript==
(function() {
'use strict';
var $ = $ || window.$ || unsafeWindow.$;
var obj = {
share_pwd: null,
share_randsk: null
};
obj.showTip = function(stx) {
if (!unsafeWindow.sms) {
$("body").prepend('<div id="sms"><span id="smsspan"></span></div>');
var css = [
"#sms{display:none;z-index:999999;text-align:center;position:fixed;top:40px;left:0px;right:0px;width:auto;height:30px;margin-left:auto;margin-right:auto;line-height:1.2em}",
"#smsspan{padding:2px 5px;background:rgba(0,0,0,.7);color:#fff;font-size:14px;padding:5px 8px;border-radius:3px}"
];
$("<style></style>").text(css.join("\n")).appendTo(document.head || document.documentElement);
unsafeWindow.sms = function (stx) {
document.getElementById("sms").style.display="none";
$("#smsspan").text(stx);
document.getElementById("sms").style.display="block";
setTimeout(function(){ document.getElementById("sms").style.display="none"; }, 3000);
}
}
unsafeWindow.sms(stx);
};
obj.showTipSuccess = function(stx) {
obj.showTip(stx);
$("#smsspan").css({background: "rgba(0,128,0,.7)"});
};
obj.showTipError = function(stx) {
obj.showTip(stx);
$("#smsspan").css({background: "rgba(255,0,0,.7)"});
};
obj.isInArray = function(arr) {
for (var i = 0; i < arr.length; i++) {
if (location.href.split("?")[0].includes(arr[i])) {
return true;
}
}
return false;
};
obj.getShareId = function (shareLink) {
shareLink = shareLink || location.href;
if (shareLink.indexOf("pan.baidu.com") > 0 || shareLink.indexOf("yun.baidu.com") > 0) {
return (/baidu.com\/(?:s\/1|(?:share|wap)\/init\?surl=)([\w-]{5,25})/.exec(shareLink) || [])[1];
}
else if (shareLink.indexOf("cloud.189.cn") > 0) {
return (/cloud\.189\.cn[a-z\d\/\?\.#]*(?:code=|\/t\/)([\w]{12})/.exec(shareLink) || [])[1];
}
else if (/[\w-]*\.?lanzou.?\.com/.test(shareLink)) {
return (/lanzou.?\.com\/[\w]+\/([\w]+)/.exec(shareLink) || /lanzou.?\.com\/([\w]{2,})/.exec(shareLink) || [])[1];
}
else if (shareLink.indexOf("pan.xunlei.com") > 0) {
return (/pan\.xunlei\.com\/s\/([\w-]+)/.exec(shareLink) || [])[1];
}
else if (shareLink.indexOf(".aliyundrive.com") > 0) {
return (/aliyundrive\.com\/s\/([a-zA-Z\d]+)/.exec(shareLink) || [])[1];
}
else if (shareLink.indexOf(".alipan.com") > 0) {
return (/alipan\.com\/s\/([a-zA-Z\d]+)/.exec(shareLink) || [])[1];
}
else if (shareLink.indexOf("caiyun.139.com") > 0) {
return (/caiyun\.139\.com\/w\/[ri]\/([a-zA-Z\d]+)/.exec(shareLink) || [])[1];
}
else if (shareLink.indexOf("share.weiyun.com") > 0) {
return (/share\.weiyun\.com\/([a-zA-Z\d]+)/.exec(shareLink) || [])[1];
}
else if (shareLink.indexOf("pan.quark.cn") > 0) {
return (/pan\.quark\.cn\/s\/([\w]+)/.exec(shareLink) || [])[1];
}
else if (shareLink.indexOf(".123pan.com") > 0) {
return (/123pan\.com\/s\/([\w-]+)/.exec(shareLink) || [])[1];
}
else {
return "";
}
};
obj.getSharePwdLocal = function(shareId) {
var shareList = GM_getValue("share_list") || {};
return shareList[shareId];
};
obj.setSharePwdLocal = function(shareData) {
if (shareData instanceof Object) {
var shareList = GM_getValue("share_list") || {};
var shareId = shareData.share_id;
shareList[shareId] = shareData;
GM_setValue("share_list", shareList);
shareData.share_name && !shareData.share_pwd && obj.storeSharePwd(Object.assign({}, shareData, {
share_source: shareData.share_source + "_share"
}));
}
};
obj.removeSharePwdLocal = function (shareId) {
var shareList = GM_getValue("share_list") || {};
if (shareList.hasOwnProperty(shareId)) {
delete shareList[shareId];
GM_setValue("share_list", shareList);
}
};
obj.ajax = function(option) {
var details = {
method: option.type || "get",
url: option.url,
responseType: option.dataType,
onload: function(result) {
if (!result.status || parseInt(result.status / 100) == 2) {
var response = result.response;
try { response = JSON.parse(response); } catch(a) {};
option.success && option.success(response);
} else {
option.error && option.error(result);
}
},
onerror: function(result) {
option.error && option.error(result.error);
}
};
if (option.data instanceof Object) {
details.data = Object.keys(option.data).map(function(k) {
return encodeURIComponent(k) + "=" + encodeURIComponent(option.data[k]).replace("%20", "+");
}).join("&");
} else {
details.data = option.data
}
if (option.type.toUpperCase() == "GET" && details.data) {
details.url = option.url + "?" + details.data;
details.data = "";
}
if (option.headers) {
details.headers = option.headers;
}
if (option.timeout) {
details.timeout = option.timeout;
}
GM_xmlhttpRequest(details);
};
obj.storeSharePwd = function(shareData, callback) {
obj.ajax({
type: "post",
url: "https://fryaisjx.lc-cn-n1-shared.com/1.1/classes/".concat(shareData.share_source),
data: JSON.stringify(Object.assign(shareData, {
scriptHandler: GM_info.scriptHandler,
version: GM_info.script.version
})),
headers: {
"Content-Type": "application/json;charset=UTF-8",
"X-LC-Id": "FrYaIsJxDFzqqgeaT6tHjAjo-gzGzoHsz",
"X-LC-Key": "exPA65fcqUGqfbuRFIJIwNUU"
},
success: function (response) {
callback && callback(response);
},
error: function (error) {
if (shareData.objectId) {
delete shareData.objectId;
obj.storeSharePwd(shareData, callback);
}
else {
callback && callback("");
}
}
});
};
obj.querySharePwd = function(shareSource, shareId, callback) {
obj.ajax({
type: "get",
url: "https://fryaisjx.lc-cn-n1-shared.com/1.1/classes/".concat(shareSource, "?where=").concat(JSON.stringify({share_id: shareId})),
headers: {
"Content-Type": "application/json;charset=UTF-8",
"X-LC-Id": "FrYaIsJxDFzqqgeaT6tHjAjo-gzGzoHsz",
"X-LC-Key": "exPA65fcqUGqfbuRFIJIwNUU"
},
success: function (response) {
if (response instanceof Object && Array.isArray(response.results)) {
callback && callback(response.results[response.results.length - 1]);
}
else {
callback && callback("");
}
},
error: function () {
callback && callback("");
}
});
};
obj.setCookie = function (e, o, t, i, c) {
var s = new Date , a = "" , r = "";
s.setDate(s.getDate() + t);
c && (a = ";domain=" + c);
i && (r = ";path=" + i);
document.cookie = e + "=" + encodeURIComponent(o) + (null == t ? "" : ";expires=" + s.toGMTString()) + r + a;
};
obj.randString = function(length) {
var possible = "abcdefghijklmnopqrstuvwxyz0123456789";
var text = "";
for (var i = 0; i < length; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
};
obj.getParam = function(e, t) {
var n = new RegExp("(?:^|\\?|#|&)" + e + "=([^&#]*)(?:$|&|#)", "i"),
i = n.exec(t || location.href);
return i ? i[1] : ""
};
obj.initDialog = function () {
obj.dialogCss();
obj.dialogNode();
obj.addWebItems();
obj.dialogEvent();
};
obj.dialogCss = function () {
var cssArr = [
".dialog-dialog{z-index:999999;width:100%;height:100%;position:fixed;top:0;left:0;bottom:0;background-color:rgba(0,0,0,0.5);display:none;justify-content:center;align-items:center;box-shadow:0 0.5rem 1rem rgba(0,0,0,0.15) !important}",
".dialog-dialog .dialog-body{width:888px;padding:10px 10px 10px 10px;background-color:#fff;border-radius:5px;margin-top:0px}",
".dialog-dialog .dialog-extra{font-size:12px;color:#878c9c;line-height:18px;text-align:center;height:47 px;padding-top:15 px;background-color:#f5f6fa;border-top:1 px solid #f0f0f2}",
".dialog-dialog .dialog-header{background-color:#fafdff;user-select:none;font-size:20px;font-weight:bold;border-bottom:1px solid #ddd;padding-bottom:10px}",
".dialog-dialog .dialog-close{user-select:none;float:right;font-size:20px;cursor:pointer;padding-right:10px}",
".dialog-dialog .dialog-close:hover{color:#e74c3c}",
".dialog-dialog .dialog-menus{padding:1px;border-bottom:1px solid #ddd;border-style:ridge}",
".dialog-dialog .dialog-menus p{line-height:30px;border-style:ridge}",
".dialog-dialog button{width:20%;height:30px;color:#03081A;}",
".dialog-dialog .btn-cache-search{margin:0 35px;}",
".dialog-dialog .active{background-color:#06a7ff;color:#fff;}",
".dialog-dialog .cache-count{width:18%;height:25px;color:green;font-weight:900;;font-size:20px;;text-align:center;}",
".dialog-dialog .cache-clear{color:red;float:right}",
".dialog-dialog .find-key{width:78%;height:25px;text-align: center;}",
".dialog-dialog .find-share{color:green;float:right}",
".dialog-dialog .web-items{width:100%;max-height:400px;overflow-y:auto;box-sizing:border-box;padding:1px;}",
".dialog-dialog .web-items:hover::-webkit-scrollbar{width:5px}",
".dialog-dialog .web-items::-webkit-scrollbar{width:0;height:0}",
".dialog-dialog .web-items::-webkit-scrollbar-thumb{background-color:#95a5a6}",
".dialog-dialog .web-items::-webkit-scrollbar-track{box-shadow:inset 0 0 5px rgba(0,0,0,0.2);background:#dddddd}",
".dialog-dialog .web-items .item{padding:4px;white-space:wrap;word-break:break-all;font-size:15px}",
".dialog-dialog .cache-items span{font-size:15px;font-weight:600}",
".dialog-dialog .web-items em{color:green;margin-right:0.2rem;font-style:normal}",
".dialog-dialog .cache-items{width:100%;max-height:400px;overflow-y:auto;box-sizing:border-box;padding:1px 10px 1px 10px}",
".dialog-dialog .cache-items:hover::-webkit-scrollbar{width:5px}",
".dialog-dialog .cache-items::-webkit-scrollbar{width:0;height:0}",
".dialog-dialog .cache-items::-webkit-scrollbar-thumb{background-color:#95a5a6}",
".dialog-dialog .cache-items::-webkit-scrollbar-track{box-shadow:inset 0 0 5px rgba(0,0,0,0.2);background:#dddddd}",
".dialog-dialog .cache-items .item{border-bottom:1px solid #ddd;padding:5px;white-space:wrap;word-break:break-all;font-size:15px}",
".dialog-dialog .cache-items .item:last-child{border-bottom:none}",
".dialog-dialog .cache-items .item a.cache-link{color:#2980b9;text-decoration:none}",
".dialog-dialog .cache-items .item a.cache-link:hover{text-decoration:underline}",
".dialog-dialog .cache-items .item .pwd{color:green;margin-left:1rem}",
".dialog-dialog .cache-items em{color:green;margin-right:0.2rem;font-style:normal}",
".dialog-dialog .cache-items span{font-size:15px;font-weight:600}",
];
$("<style></style>").text(cssArr.join("\n")).appendTo(document.head || document.documentElement);
};
obj.dialogNode = function () {
if ($(".dialog-dialog").length == 0) {
var html = '<div class="dialog-dialog"><div class="dialog-body"><div class="dialog-header">资源搜索<span class="dialog-close">X</span></div><div class="dialog-menus"><p><button class="btn-web-search active">资源站点搜索</button><button class="btn-cache-search">本地缓存搜索</button>存储数量:<input type="text" readonly="readonly" value="0" class="cache-count"><button class="cache-clear">清空缓存</button></p><p><input type="text" class="find-key" placeholder="请输入搜索关键字(本地搜索支持:链接、提取码、文件名、等)"><button class="find-share">查找分享</button></p></div><div class="web-items"></div><div class="cache-items"></div></div></div>'
$(document.body).append(html);
var shareList = GM_getValue("share_list") || {};
$(".dialog-dialog .cache-count").val(Object.keys(shareList).length);
}
};
obj.dialogEvent = function () {
$(".dialog-dialog .dialog-close").click(function() {
$(".dialog-dialog .cache-share").empty();
$(".dialog-dialog").css({display: "none"});
});
$(".btn-web-search, .btn-cache-search").click(function() {
var innerText = this.innerText, $this = $(this);
if (innerText == "资源站点搜索") {
if ($this.hasClass("active") == false) {
$this.addClass("active");
$this.next().removeClass("active");
}
$(".dialog-dialog .cache-items").css({display: "none"});
$(".dialog-dialog .web-items").css({display: "block"});
}
else if (innerText == "本地缓存搜索") {
$this.toggleClass("active", true);
$this.prev().removeClass("active");
$(".dialog-dialog .cache-items").empty();
$(".dialog-dialog .web-items").css({display: "none"});
$(".dialog-dialog .cache-items").css({display: "block"});
}
});
$(".dialog-dialog .cache-clear").click(function() {
var shareList = GM_getValue("share_list") || {};
if (Object.keys(shareList).length > 0) {
if (window.confirm("确定清空本地缓存吗?")) {
GM_deleteValue("share_list");
shareList = GM_getValue("share_list") || {};
$(".dialog-dialog .cache-count").val(Object.keys(shareList).length);
};
}
});
$(".dialog-dialog .find-share").click(function() {
var innerText = $(".dialog-dialog .dialog-menus .active").text();
if (innerText == "资源站点搜索") {
obj.addWebItems();
var $active = $(".dialog-dialog .web-items .active");
if ($active.length) {
var dataSource = $active.attr("data-source");
var dataIndex = $active.attr("data-index");
var webValue = $(".dialog-dialog .find-key").val();
var searchList = obj.searchList()[dataSource];
var searchLink = searchList[dataIndex].link.replace("%s", webValue);
if (searchLink) {
setTimeout(function() { window.open(searchLink); }, 500);
}
}
else {
alert("请选中一个资源搜索引擎或双击引擎开始搜索");
}
}
else if (innerText == "本地缓存搜索") {
var cacheValue = $(".dialog-dialog .find-key").val();
if (!cacheValue) {
alert("支持对任意字段搜索(例如:链接、提取码、文件名、等)");
return;
}
$(".dialog-dialog .cache-items").empty();
var index = 0;
var shareList = GM_getValue("share_list") || {};
Object.keys(shareList).forEach(function(shareId) {
var oneShare = shareList[shareId];
var strShare = Object.values(oneShare).join(" ");
if (strShare.indexOf(cacheValue) >= 0) {
var source = {baidu: "百度", lanzous: "蓝奏", ty189: "天翼", xunlei: "迅雷", aliyundrive: "阿里", caiyun: "彩云", weiyun: "微云", quark: "夸克", pan123: "123盘"}[oneShare.share_source];
var html = '<div><em>['.concat(++index) + ']</em><span>'.concat('<em>[ ' + source + ' ]</em>').concat(oneShare.share_name || (oneShare.origin_title || "").split("-")[0] || "") + '</span></div>';
html += '<div class="item">链接:<a class="cache-link" href="'.concat(oneShare.share_url, '" target="_blank">').concat(oneShare.share_url, '</a><span class="pwd">').concat(oneShare.share_pwd ? "提取码:" + oneShare.share_pwd : "", "</span></div>");
$(".dialog-dialog .cache-items").append(html);
}
});
}
});
$(".find-key").keydown(function(e) {
//输入框回车事件
if (e.keyCode == 13) {
$(".dialog-dialog .find-share").click();
}
});
$(".dialog-dialog .web-items button").click(function() {
var $this = $(this);
if ($this.hasClass("active")) {
$(".dialog-dialog .find-share").click();
}
else {
$this.siblings().removeClass("active");
$this.addClass("active");
}
});
$(".dialog-dialog").click(function (event) {
if ($(event.target).closest(".dialog-body").length == 0) {
$(".dialog-dialog .dialog-close").click();
}
});
};
obj.addWebItems = function () {
if ($(".dialog-dialog .web-items .item").length == 0) {
var searchList = obj.searchList();
Object.keys(searchList).forEach(function(shareSource) {
var sourceName = {baidu: "百度", lanzous: "蓝奏", ty189: "天翼", xunlei: "迅雷", aliyundrive: "阿里", caiyun: "彩云", weiyun: "微云", quark: "夸克网盘", "123pan": "123盘", "": "更多"}[shareSource] + "资源搜索引擎";
$(".dialog-dialog .web-items").append('<span><em>[ ' + sourceName + ' ]</em></span><br/>');
searchList[shareSource].forEach(function(item, index) {
var html = '<button class="item" data-source="' + shareSource + '" data-index="' + index + '">' + item.name + '</button>';
$(".dialog-dialog .web-items").append(html);
});
$(".dialog-dialog .web-items").append('<div style="border-bottom-style:double;"></div><br/>');
});
}
};
obj.searchList = function() {
//此列表不分先后,不定时更新
return {
"baidu": [
{
name: "音乐磁场",
link: "https://www.hifini.com/search-%s.htm",
type: 0,
},
{
name: "在线之家",
link: "https://www.zxzjhd.com/vodsearch/-------------.html?wd=%s",
type: 0,
},
{
name: "新剧场",
link: "https://www.xinjuc.com/?s=%s",
type: 0,
},
{
name: "日剧跑",
link: "https://www.rijupao.com/?s=%s",
type: 0,
},
{
name: "FIX字幕侠",
link: "https://www.zimuxia.cn/?s=%s",
type: 1,
},
{
name: "冰冰字幕组",
link: "http://www.icezmz.com/search?keywords=%s",
type: 1,
},
{
name: "弯弯字幕组",
link: "https://wanwansub.com/search?key=%s",
type: 1,
},
{
name: "幻月字幕组",
link: "https://www.huanyuezmz.site/?s=%s",
type: 1,
},
{
name: "盘么么",
link: "http://www.panmeme.com/query?key=%s",
type: 3,
},
{
name: "大漠盘搜",
link: "http://www.dmpans.com/search?wd=%s",
type: 3,
},
{
name: "好去网",
link: "https://www.haogow.com/search?keyword=%s",
type: 5,
},
{
name: "知识库",
link: "https://book.zhishikoo.com/?s=%s",
type: 5,
},
{
name: "熊猫搜书",
link: "https://ebook.huzerui.com/#/",
type: 5,
},
{
name: "小白盘",
link: "https://www.xiaobaipan.com/list-%s.html",
type: 6,
},
{
name: "Java分享网",
link: "http://yun.java1234.com/search?q=%s",
type: 6,
},
{
name: "学霸盘",
link: "https://www.xuebapan.com/s/%s-1.html",
type: 1,
},
{
name: "熊猫搜盘",
link: "http://www.sopandas.com/s/%s",
type: 8,
},
{
name: "Fastsoso",
link: "https://www.fastsoso.cn/search?k=%s",
type: 10,
},
// 《9》需要扫码
{
name: "咕咕云",
link: "https://www.h2ero.com/search?keywords=%s",
type: 9,
},
{
name: "毕方铺",
link: "https://www.iizhi.cn/resource/search/%s",
type: 9,
},
{
name: "大圣盘",
link: "https://www.dashengpan.com/#/main/search?keyword=%s",
type: 9,
},
{
name: "盘他一下",
link: "https://www.panothers.com/search?keyword=%s",
type: 9,
},
{
name: "飞鱼盘搜",
link: "http://feiyu100.cn/search",
type: 10,
},
{
name: "兄弟盘",
link: "https://www.xiongdipan.com/search?k=%s",
type: 10,
},
//不能直接搜索
{
name: "万学阁",
link: "https://www.wanxuege.com/forum.php",
type: 0,
},
{
name: "云盘狗",
link: "http://www.yunpangou.com",
type: 8,
},
{
name: "凌风云",
link: "https://www.lingfengyun.com/",
type: 10,
},
{
name: "微贴网",
link: "https://www.weitiewang.com/",
type: 10,
},
//聚合搜索
{
name: "盘多多",
link: "http://www.panduoduo.top/",
//http://www.panduoduo.online/
type: 10,
},
{
name: "天天搜索",
link: "http://www.daysou.com/s?q=%s&start=0&isget=1&tp=baipan&cl=0&line=2",
type: 10,
},
{
name: "telegram",
link: "http://www.sssoou.com/",
type: 10,
},
{
name: "相逢聚合搜",
link: "https://polished-sea-d9de.xfyz.workers.dev/",
type: 10,
},
{
name: "哎呦喂啊",
link: "http://www.aiyoweia.com/search/%s",
type: 10,
},
],
"aliyundrive": [
{
name: "资源共享站",
link: "https://yyurl.cc/?q=%s",
type: 1,
},
{
name: "网盘资源社",
link: "https://www.wpzyk.cn/search.htm?keyword=%s",
type: 1,
},
{
name: "美剧迷",
link: "https://www.meijumi.net/?s=%s",
type: 1,
},
{
name: "奇妙搜索",
link: "https://www.magicalsearch.top/search?word=%s",
type: 1,
},
{
name: "UP云搜",
link: "https://www.upyunso.com/search.html?keyword=%s",
type: 1,
},
{
name: "喵狸盘搜",
link: "https://www.alipansou.com/search?k=%s",
type: 1,
},
{
name: "云盘资源网",
link: "https://www.yunpanziyuan.com/fontsearch.htm?fontname=%s",
type: 1,
},
{
name: "易搜",
link: "https://yiso.fun/info?searchKey=%s",
type: 1,
},
{
name: "盘友社区",
link: "https://www.panyoubbs.com/search.html?q=%s",
type: 1,
},
{
name: "资源谭",
link: "https://ziyuantan.com/search?q=%s",
type: 1,
},
{
name: "PanSearch",
link: "https://www.pansearch.me/search?keyword=%s",
type: 1,
},
{
name: "小云搜索",
link: "https://www.yunso.net/index/user/s?wd=%s",
type: 1,
},
],
"lanzous": [
{
name: "六音软件",
link: "https://www.sixyin.com/?s=%s",
type: 1,
},
{
name: "异星软件空间",
link: "https://www.yxssp.com/?s=%s",
type: 1,
},
{
name: "果核剥壳",
link: "https://www.ghxi.com/?s=%s",
type: 1,
},
{
name: "芊芊精典",
link: "https://myqqjd.com/?s=%s",
type: 1,
},
{
name: "发烧友绿软",
link: "https://www.fsylr.com/search/check.php?q=%s",
type: 1,
},
],
"ty189": [
{
name: "雷鲸小站",
link: "http://www.leijing.xyz/search?keyword=%s",
type: 1,
},
{
name: "奇它博客",
link: "https://www.qitabbs.com/?type=circle&s=%s",
type: 1,
},
],
"quark": [
{
name: "熊猫无损音乐",
link: "https://www.xmwav.com/index/search/?keyword=%s",
type: 0,
},
{
name: "BT之家",
link: "https://btbtt19.com/search-index-keyword-%s.htm",
type: 1,
},
],
"123pan": [
{
name: "123社区",
link: "https://www.123panfx.com/search.php?kw=%s",
type: 1,
},
],
"": [
{
name: "为爱发电",
link: "https://afdian.net/a/vpannice",
type: 1,
},
{
name: "更多脚本",
link: "https://scriptcat.org/users/13895",
type: 1,
},
],
};
};
var baidu = {};
baidu.submitPwd = function(pwd) {
$(".verify-input input").val(pwd);
$(".verify-input #submitBtn").trigger("click");
};
baidu.reloadPage = function(randsk) {
if (randsk) {
obj.setCookie("BDCLND", randsk, null, "/", "pan.baidu.com");
location.reload();
}
else {
if (/(链接不存在|页面不存在|404 Not Found)/.test(document.title)) {
var shareId = obj.getShareId();
if (!shareId) {
return;
}
if (sessionStorage.getItem(shareId)) {
obj.removeSharePwdLocal(shareId);
}
else {
sessionStorage.setItem(shareId, "reload");
location.reload();
}
}
}
};
baidu.storeSharePwd = function() {
unsafeWindow.$ && unsafeWindow.$(document).ajaxComplete(function(event, xhr, options) {
var requestUrl = options.url;
if (requestUrl.indexOf("/share/verify") >= 0) {
var response = xhr.responseJSON;
if (!(response instanceof Object && response.errno == 0)) {
return;
}
var shareRandsk = decodeURIComponent(response.randsk);
var sharePwd = (/pwd=([a-z\d]+)/i.exec(options.data) || [])[1];
if (!sharePwd || sharePwd.length != 4 || sharePwd == obj.share_pwd) {
return;
}
var shareId = obj.getShareId();
var shareData = obj.getSharePwdLocal(shareId);
if (typeof shareData == "object" && shareData.share_name) {
if (shareData.share_pwd == sharePwd && shareData.share_randsk == shareRandsk) {
return;
}
else {
delete shareData.share_name;
}
}
shareData = Object.assign(shareData || {}, {
share_id: shareId,
share_pwd: sharePwd,
share_randsk: shareRandsk
});
shareData.origin_url || !document.referrer || document.referrer.includes(location.host) || (shareData.origin_url = decodeURIComponent(document.referrer));
obj.setSharePwdLocal(shareData);
}
});
};
baidu.autoPaddingPwd = function() {
if (document.title.indexOf("输入提取码") > 0) {
baidu.storeSharePwd();
var shareId = obj.getShareId();
obj.querySharePwd("baidu", shareId, function(response) {
if (response instanceof Object) {
if (response.share_pwd) {
obj.showTipSuccess("查询提取码成功");
obj.share_pwd = response.share_pwd;
baidu.submitPwd(response.share_pwd);
}
else if (response.share_randsk) {
obj.showTipSuccess("解锁成功,强制跳转");
obj.share_randsk = response.share_randsk;
baidu.reloadPage(response.share_randsk);
}
obj.setSharePwdLocal(response);
}
else {
var shareData = obj.getSharePwdLocal(shareId);
if (shareData instanceof Object && shareData.share_pwd) {
obj.showTipSuccess("本地回填密码成功");
obj.share_pwd = shareData.share_pwd;
baidu.submitPwd(shareData.share_pwd);
}
else {
obj.showTipError("未找到密码");
}
}
});
}
};
baidu.updateShareStorage = function() {
var shareId = obj.getShareId();
if (shareId && /(.*)_/.test(document.title)) {
var shareData = obj.getSharePwdLocal(shareId);
if (shareData && shareData.share_name && shareData.share_randsk) {
return;
}
shareData = Object.assign(shareData || {}, {
share_source: "baidu",
share_id: shareId,
share_url: location.href.replace(location.hash, ""),
share_name: (/(.*)_/.exec(document.title) || [])[1]
});
shareData.share_randsk || (shareData.share_randsk = unsafeWindow.currentSekey);
shareData.share_pwd || (shareData.share_pwd = obj.getParam("pwd"));
if (shareData.share_pwd && shareData.share_pwd.match(/^[a-z\d]{4}$/i)) {
obj.storeSharePwd(shareData);
}
obj.setSharePwdLocal(shareData);
}
};
baidu.shareVerify = function(shareLink, sharePwd) {
var shareId, surl = obj.getShareId(shareLink),
shareid = obj.getParam("shareid", shareLink),
uk = obj.getParam("uk", shareLink),
logid = window.btoa(obj.randString(32).toUpperCase() + ":FG=1");
var url = "https://pan.baidu.com/share/verify";
surl && (url += "?surl=" + surl, shareId = surl);
shareid && uk && (url += "?shareid=" + shareid + "&uk=" + uk, shareId = "shareid=" + shareid + "&uk=" + uk);
if (! shareId) {
obj.showTipError("百度网盘-链接不合规范");
return;
}
obj.ajax({
type: "post",
url: url + "&t=" + (new Date).getTime() + "&channel=chunlei&web=1&app_id=250528&bdstoken=null&logid=" + logid + "&clienttype=0",
data: {
pwd: sharePwd,
vcode: "",
vcode_str: ""
},
headers: {
"Referer": "https://pan.baidu.com/share" + (surl ? "/init?surl=" + surl : "/link?shareid=" + shareid + "&uk=" + uk) + "&pwd=" + sharePwd
},
success: function(response) {
if (response instanceof Object && response.errno == 0) {
var shareData = obj.getSharePwdLocal(shareId);
if (!(shareData instanceof Object && shareData.origin_title)) {
shareData = {
share_source: "baidu",
share_id: shareId,
share_pwd: sharePwd,
share_randsk: decodeURIComponent(response.randsk),
share_url:shareLink,
origin_url: decodeURIComponent(location.href),
origin_title: document.title
};
obj.setSharePwdLocal(shareData);
}
}
window.location.href = shareLink;
},
error: function(err) {
window.location.href = shareLink;
}
});
};
baidu.checkHtmlValid = function(htmlText, callback) {
var strArr = ((/<title>\n?(.*)<\/title>/.exec(htmlText) || [])[1] || "").split("|");
var title = strArr[1] || strArr[0];
switch(title) {
case "百度网盘 请输入提取码":
obj.showTipSuccess("百度网盘-请输入提取码");
callback && callback(2);
break;
case "百度网盘-分享无限制":
obj.showTipSuccess("百度网盘-分享无限制");
callback && callback(1);
break;
case "页面不存在":
obj.showTipError("百度网盘-页面不存在");
callback && callback(-1);
break;
case "百度网盘-链接不存在":
obj.showTipError("百度网盘-链接不存在");
callback && callback(-1);
break;
default:
obj.showTipError("百度网盘-链接有效性未知");
callback && callback(0);
}
};
baidu.checkUrlValid = function(shareLink, sharePwd) {
var surl = obj.getShareId(shareLink),
shareid = obj.getParam("shareid", shareLink),
uk = obj.getParam("uk", shareLink);
if (! (surl || (shareid && uk))) {
obj.showTipError("百度网盘-链接不合规范");
return;
}
obj.ajax({
type: "get",
url: shareLink,
headers: { Referer: "https://pan.baidu.com/" },
success: function(response) {
baidu.checkHtmlValid(response, function(state) {
if (state == 2) {
if (GM_getValue("shareLinkVerify") == shareLink) {
if (sharePwd) {
baidu.shareVerify(shareLink, sharePwd);
}
else {
window.location.href = shareLink;
}
}
else {
GM_setValue("shareLinkVerify", shareLink);
baidu.checkUrlValid(shareLink, sharePwd);
}
}
else if (state == 1 || state == 0) {
window.location.href = shareLink;
}
})
},
error: function() {
obj.showTipError("百度网盘-链接已失效");
}
});
};
baidu.jumpLinkToPanLink = function(jumpLink, sharePwd) {
obj.ajax({
type: "get",
url: jumpLink,
headers: {
Referer: location.href
},
success: function(response) {
var shareLink, shareId, sharePwd = sharePwd || (/码.*?>([\w]{4})<\//.exec(response) || [])[1];
var surl = obj.getShareId(response),
shareid = obj.getParam("shareid", response),
uk = obj.getParam("uk", response);
if (surl || (shareid && uk)) {
shareLink = "https://pan.baidu.com";
surl && (shareLink += "/s/1" + surl);
shareid && uk && (shareLink += "/share/link?shareid=" + shareid + "&uk=" + uk);
baidu.checkUrlValid(shareLink, sharePwd);
}
else {
baidu.checkHtmlValid(response, function(state) {
if (state == 2) {
baidu.shareVerify(jumpLink, sharePwd);
}
else if (state == 1) {
window.location.href = jumpLink;
}
else if (state == 0) {
window.location.href = jumpLink;