|
75 | 75 | // @include http*://www.l-sj.cc/* |
76 | 76 | // @include http*://htacg.cc/* |
77 | 77 | // @include http*://www.htacg.cc/* |
78 | | -// @version 3.21.32 |
| 78 | +// @version 3.21.33 |
79 | 79 | // @grant GM_notification |
80 | 80 | // @grant GM_xmlhttpRequest |
81 | 81 | // @grant GM_setClipboard |
82 | 82 | // @grant GM_setValue |
83 | 83 | // @grant GM_getValue |
84 | 84 | // @grant unsafeWindow |
85 | 85 | // @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 |
87 | 87 | // @require https://cdn.jsdelivr.net/crypto-js/3.1.2/components/core-min.js |
88 | 88 | // @require https://cdn.jsdelivr.net/crypto-js/3.1.2/rollups/aes.js |
89 | 89 | // @updateURL https://greasyfork.org/scripts/23316/code/HacgGodTurn.user.js |
|
1025 | 1025 | }; |
1026 | 1026 | oD_text=document.createElement("input"); |
1027 | 1027 | 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密文"; |
1030 | 1030 | oD_text.title='将自动添加"magnet:?xt=urn:btih:"并去除非法字符'; |
1031 | 1031 | oD_button=document.createElement("button"); |
1032 | 1032 | oD_button.type="button"; |
|
1036 | 1036 | oD_link.textContent=oD_link2.textContent=oD_link3.textContent=""; |
1037 | 1037 | var oD_hash=oD_text.value; |
1038 | 1038 | 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)){ |
1041 | 1041 | var panMatch=oD_hash.match(/\b1[0-9a-z]{6,7}/i); |
1042 | 1042 | var ecode=oD_hash.trim(),url="https://pan.baidu.com/s/"+panMatch; |
1043 | 1043 | var shortMatch=/\b1[0-9a-z]{6,7}\s*([0-9a-z]{4})\b/i.exec(ecode); |
|
1054 | 1054 | }else{ |
1055 | 1055 | oD_hash=oD_hash.replace(/(\[.*\])|[\W_]/g,""); |
1056 | 1056 | 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值格式错误"); |
1058 | 1066 | }else{ |
1059 | 1067 | oD_link.href="magnet:?xt=urn:btih:"+oD_hash; |
1060 | 1068 | oD_link.textContent="磁链"; |
|
0 commit comments