Skip to content

Commit 5787cc9

Browse files
committed
fix
1 parent a861f73 commit 5787cc9

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

HacgGodTurn/HacgGodTurn.user.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@
7575
// @include http*://www.l-sj.cc/*
7676
// @include http*://htacg.cc/*
7777
// @include http*://www.htacg.cc/*
78-
// @version 3.21.32
78+
// @version 3.21.33
7979
// @grant GM_notification
8080
// @grant GM_xmlhttpRequest
8181
// @grant GM_setClipboard
8282
// @grant GM_setValue
8383
// @grant GM_getValue
8484
// @grant unsafeWindow
8585
// @run-at document-end
86-
// @require https://greasyfork.org/scripts/23522/code/od.js?version=169400
86+
// @require https://greasyfork.org/scripts/23522/code/od.js?version=169890
8787
// @require https://cdn.jsdelivr.net/crypto-js/3.1.2/components/core-min.js
8888
// @require https://cdn.jsdelivr.net/crypto-js/3.1.2/rollups/aes.js
8989
// @updateURL https://greasyfork.org/scripts/23316/code/HacgGodTurn.user.js
@@ -1025,8 +1025,8 @@
10251025
};
10261026
oD_text=document.createElement("input");
10271027
oD_text.type="text";
1028-
oD_text.style.cssText="width:168px;height:33px;position:relative;margin-top:0px;padding:0px;box-sizing:border-box;z-index:0";
1029-
oD_text.placeholder="输入hash值或网盘地址";
1028+
oD_text.style.cssText="width:248px;height:33px;position:relative;margin-top:0px;padding:0px;box-sizing:border-box;z-index:0";
1029+
oD_text.placeholder="输入hash值、网盘地址或Base64密文";
10301030
oD_text.title='将自动添加"magnet:?xt=urn:btih:"并去除非法字符';
10311031
oD_button=document.createElement("button");
10321032
oD_button.type="button";
@@ -1036,8 +1036,8 @@
10361036
oD_link.textContent=oD_link2.textContent=oD_link3.textContent="";
10371037
var oD_hash=oD_text.value;
10381038
if(oD_hash===""){
1039-
alert("请输入hash值、网盘或下载地址");
1040-
}else if(/\b1[0-9a-z]{6,7}/i.test(oD_hash)){
1039+
alert("请输入hash值、网盘或Base64密文");
1040+
}else if(/\b1[0-9a-z]{6,7}(\b|$)/i.test(oD_hash)){
10411041
var panMatch=oD_hash.match(/\b1[0-9a-z]{6,7}/i);
10421042
var ecode=oD_hash.trim(),url="https://pan.baidu.com/s/"+panMatch;
10431043
var shortMatch=/\b1[0-9a-z]{6,7}\s*([0-9a-z]{4})\b/i.exec(ecode);
@@ -1054,7 +1054,15 @@
10541054
}else{
10551055
oD_hash=oD_hash.replace(/(\[.*\])|[\W_]/g,"");
10561056
if(!regObj.btih.test(oD_hash)){
1057-
alert("hash值格式错误");
1057+
if(/^[\da-z\/\+\=]+$/i.test(oD_hash)){
1058+
try{
1059+
GM_setClipboard(CryptoJS.enc.Base64.parse(oD_hash).toString(CryptoJS.enc.Utf8));
1060+
alert("Base64解密结果已复制");
1061+
}catch(e){
1062+
alert(e+" 格式错误");
1063+
}
1064+
}else
1065+
alert("hash值格式错误");
10581066
}else{
10591067
oD_link.href="magnet:?xt=urn:btih:"+oD_hash;
10601068
oD_link.textContent="磁链";

HacgGodTurn/od.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)