Skip to content

Commit 7facc90

Browse files
committed
fix
1 parent 669f268 commit 7facc90

3 files changed

Lines changed: 34 additions & 23 deletions

File tree

Easy offline/Easy offline.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// @description:zh-TW 一鍵自動將磁鏈、bt種子或其他下載資源離綫下載至網槃
88
// @namespace http://tampermonkey.net/
99
// @require http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js
10-
// @version 1.0.37
10+
// @version 1.0.38
1111
// @author Hoothin
1212
// @mail rixixi@gmail.com
1313
// @include http*://*/*
@@ -261,8 +261,8 @@
261261
var b32 = {'a':'00000','b':'00001','c':'00010','d':'00011','e':'00100','f':'00101','g':'00110','h':'00111','i':'01000','j':'01001','k':'01010','l':'01011','m':'01100','n':'01101','o':'01110','p':'01111','q':'10000','r':'10001','s':'10010','t':'10011','u':'10100','v':'10101','w':'10110','x':'10111','y':'11000','z':'11001','2':'11010','3':'11011','4':'11100','5':'11101','6':'11110','7':'11111'};
262262
var b16 = {'0000':'0','0001':'1','0010':'2','0011':'3','0100':'4','0101':'5','0110':'6','0111':'7','1000':'8','1001':'9','1010':'a','1011':'b','1100':'c','1101':'d','1110':'e','1111':'f'};
263263
function base32ToHex(str){
264-
if(str.length % 8 !== 0){
265-
return null;
264+
if(str.length % 8 !== 0 || /[0189].test(str)/){
265+
return str;
266266
}
267267
str = str.toLowerCase();
268268
var bin = "", returnStr = "", i;

HacgGodTurn/HacgGodTurn.user.js

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@
4949
// @include http*://htai.*
5050
// @include http*://gmgard.com/*
5151
// @include http*://*.gmgard.com/*
52-
// @version 3.20.49
52+
// @version 3.20.50
5353
// @grant GM_notification
5454
// @grant GM_xmlhttpRequest
5555
// @run-at document-end
56-
// @require https://greasyfork.org/scripts/23522/code/od.js?version=159126
56+
// @require https://greasyfork.org/scripts/23522/code/od.js?version=159140
5757
// @require https://cdn.jsdelivr.net/crypto-js/3.1.2/components/core-min.js
5858
// @require https://cdn.jsdelivr.net/crypto-js/3.1.2/rollups/aes.js
5959
// @license MIT License
@@ -191,7 +191,7 @@
191191
},
192192
{
193193
name:"acgzone",
194-
url:"http://www.uraban.me/",
194+
url:"http://www.uraban.me/wp/",
195195
regex:/acgzone\.org|uraban\.me/,
196196
contentArea:'article'
197197
},
@@ -717,30 +717,41 @@
717717
};
718718
var oD_text=document.createElement("input");
719719
oD_text.type="text";
720-
oD_text.style.cssText="width:168px;height:33px;position:relative;margin-top: 0px;padding: 0px;";
721-
oD_text.placeholder="输入hash值";
720+
oD_text.style.cssText="width:168px;height:33px;position:relative;margin-top:0px;padding:0px;box-sizing:border-box;";
721+
oD_text.placeholder="输入hash值、网盘或下载地址";
722722
oD_text.title='将自动添加"magnet:?xt=urn:btih:"并去除非法字符';
723723
var oD_button=document.createElement("button");
724724
oD_button.type="button";
725725
oD_button.textContent="开车";
726726
oD_button.style.cssText="padding:4px 0;position: absolute;top:-1px;right:0px;width:40px;height:35px";
727727
oD_button.onclick=function (){
728-
var oD_hash=oD_text.value.replace(/(\[.*\])|[\W_]/g,"");
728+
var oD_hash=oD_text.value;
729729
if(oD_hash===""){
730-
alert("请输入hash值");
731-
return;
732-
}else if(!regObj.btih.test(oD_hash)){
733-
alert("hash值格式错误");
734-
return;
730+
alert("请输入hash值、网盘或下载地址");
731+
}else if(/\b1[0-9a-z]{6,7}/i.test(oD_hash)){
732+
var panMatch=oD_hash.match(/\b1[0-9a-z]{6,7}/i);
733+
var ecode=oD_hash.trim(),url="https://pan.baidu.com/s/"+panMatch;
734+
ecode=simpleRule.test(ecode)?ecode.match(simpleRule)[1]:codeRule.test(ecode)?ecode.match(codeRule)[1]:"";
735+
if(ecode)url+="#"+ecode;
736+
window.open(url);
737+
}else if(/^\s*(https|ftp)?:\/\//.test(oD_hash)){
738+
var url=oD_hash.replace(/[^a-z0-9:\/%\?&\._\-\+\*]/gi,"");
739+
window.open(url);
740+
}else{
741+
oD_hash=oD_hash.replace(/(\[.*\])|[\W_]/g,"");
742+
if(!regObj.btih.test(oD_hash)){
743+
alert("hash值格式错误");
744+
}else{
745+
oD_link.href="magnet:?xt=urn:btih:"+oD_hash;
746+
oD_link.textContent="磁链";
747+
oD_link2.href="http://www.torrent.org.cn/Home/torrent/download.html?hash="+oD_hash;
748+
oD_link2.textContent="种子";
749+
oD_link2.style.cssText="margin-left:20px";
750+
oD_link3.href="https://btso.pw/magnet/detail/hash/"+oD_hash;
751+
oD_link3.textContent="详情";
752+
oD_link3.style.cssText="margin-left:20px";
753+
}
735754
}
736-
oD_link.href="magnet:?xt=urn:btih:"+oD_hash;
737-
oD_link.textContent="磁链";
738-
oD_link2.href="http://www.torrent.org.cn/Home/torrent/download.html?hash="+oD_hash;
739-
oD_link2.textContent="种子";
740-
oD_link2.style.cssText="margin-left:20px";
741-
oD_link3.href="https://btso.pw/magnet/detail/hash/"+oD_hash;
742-
oD_link3.textContent="详情";
743-
oD_link3.style.cssText="margin-left:20px";
744755
};
745756
var oD_link=document.createElement("a");
746757
var oD_link2=document.createElement("a");

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)