Skip to content

Commit fe360f9

Browse files
committed
Update HacgGodTurn.user.js
1 parent 381eacd commit fe360f9

1 file changed

Lines changed: 83 additions & 24 deletions

File tree

HacgGodTurn/HacgGodTurn.user.js

Lines changed: 83 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@
114114
// @include http*://greasyfork.org/*/scripts/*
115115
// @include http*://sleazyfork.org/*/forum/*discussion*
116116
// @include http*://greasyfork.org/*/forum/*discussion*
117-
// @version 3.22.68
117+
// @version 3.22.69
118118
// @grant GM_notification
119119
// @grant GM_xmlhttpRequest
120120
// @grant GM_setClipboard
121121
// @grant GM_setValue
122122
// @grant GM_getValue
123123
// @grant unsafeWindow
124124
// @run-at document-end
125-
// @require https://greasyfork.org/scripts/23522/code/od.js
125+
// @require https://greasyfork.org/scripts/23522/code/od.js?version=997431
126126
// @require https://cdn.jsdelivr.net/crypto-js/3.1.2/components/core-min.js
127127
// @require https://cdn.jsdelivr.net/crypto-js/3.1.2/rollups/aes.js
128128
// @license MIT License
@@ -914,7 +914,7 @@
914914
$(document).ready(function() { register_qrcode_event('#qrcode_magnet', '#qrcode_magnet_enlarged');
915915
register_qrcode_event('#qrcode_download', '#qrcode_download_enlarged'); }); } else if (Config['user_script']['platform'] == 'mobile') { $('#torrent_url').attr('href', torrent_url.full).text('种子下载').click(function() { return (prompt('确认下载该种子', torrent_url.full) ? true : false); });
916916
$('#magnet_url').attr('href', magnet_url.full).text('磁力下载').click(function() { return (prompt('确认下载磁链', magnet_url.full) ? true : false); }); } else { return false; }
917-
})(jQuery);
917+
})(unsafeWindow.jQuery);
918918
}
919919
},
920920
{
@@ -947,43 +947,102 @@
947947
$(document).ready(function() { register_qrcode_event('#qrcode_magnet', '#qrcode_magnet_enlarged');
948948
register_qrcode_event('#qrcode_download', '#qrcode_download_enlarged'); }); } else if (Config['user_script']['platform'] == 'mobile') { $('#torrent_url').attr('href', torrent_url.full).text('种子下载').click(function() { return (prompt('确认下载该种子', torrent_url.full) ? true : false); });
949949
$('#magnet_url').attr('href', magnet_url.full).text('磁力下载').click(function() { return (prompt('确认下载磁链', magnet_url.full) ? true : false); }); } else { return false; }
950-
})(jQuery);
950+
})(unsafeWindow.jQuery);
951951
}
952952
},
953953
{
954954
name:"漫猫",
955955
url:"http://comicat.org/",
956956
regex:/comicat\./,
957957
run:function(){
958-
var acgscript_config = { "miobt": { "4": { "api_url": "http://v2.uploadbt.com" } } };
959958
(function($) {
960-
if (acgscript_config['miobt']['4']['loaded']) { return false; }
959+
var acgscript_config = {
960+
"miobt": {
961+
"4": {
962+
"api_url": "http://v2.uploadbt.com",
963+
"source": "cdn.acgscript.com"
964+
}
965+
}
966+
};
967+
if (acgscript_config['miobt']['4']['loaded']) {
968+
return false;
969+
}
961970
acgscript_config['miobt']['4']['loaded'] = true;
962971
var log_name = 'acgscript/miobt/bt_download';
963-
console.log([log_name, { 'loaded': acgscript_config['miobt']['4']['loaded'], 'api_url': acgscript_config['miobt']['4']['api_url'], 'mika_mode': Config['mika_mode']['enabled'], 'in_script': Config['in_script'], 'platform': Config['user_script']['platform'] }]);
964-
if (!Config['mika_mode']['enabled']) { return false; }
965-
if (Config['in_script'] !== 'show') { return false; }
966-
if (!$('#box_download')) { return false; }
972+
console.log([log_name, {
973+
'source': acgscript_config['miobt']['4']['source'],
974+
'loaded': acgscript_config['miobt']['4']['loaded'],
975+
'api_url': acgscript_config['miobt']['4']['api_url'],
976+
'mika_mode': Config['mika_mode']['enabled'],
977+
'in_script': Config['in_script'],
978+
'platform': Config['user_script']['platform']
979+
}]);
980+
if (!Config['mika_mode']['enabled']) {
981+
return false;
982+
}
983+
if (Config['in_script'] !== 'show') {
984+
return false;
985+
}
986+
if (!$('#box_download')) {
987+
return false;
988+
}
967989
var api_url = acgscript_config['miobt']['4']['api_url'];
968-
var torrent_url = { "lite": api_url + '/?r=down&hash=' + Config['hash_id'], 'full': api_url + '/?r=down&hash=' + Config['hash_id'] + '&name=' + Config['down_torrent_format'].replace('%s', Config['bt_data_title']) };
969-
var magnet_url = { 'lite': 'magnet:?xt=urn:btih:' + Config['hash_id'], 'full': 'magnet:?xt=urn:btih:' + Config['hash_id'] + '&tr=' + Config['announce'] };
970-
if (Config['user_script']['platform'] == 'desktop') { $('#box_download h2.title').text('下载地址');
990+
var torrent_url = {
991+
"lite": api_url + '/?r=down&hash=' + Config['hash_id'],
992+
'full': api_url + '/?r=down&hash=' + Config['hash_id'] + '&name=' + Config['down_torrent_format'].replace('%s', Config['bt_data_title'])
993+
};
994+
var magnet_url = {
995+
'lite': 'magnet:?xt=urn:btih:' + Config['hash_id'],
996+
'full': 'magnet:?xt=urn:btih:' + Config['hash_id'] + '&tr=' + Config['announce']
997+
};
998+
if (Config['user_script']['platform'] == 'desktop') {
999+
$('#box_download h2.title').text('下载地址');
9711000
$('#magnet').attr('href', magnet_url.full).text('磁链下载');
9721001
$('#download').attr('href', torrent_url.full).text('种子下载');
9731002
$('#qrcode_magnet').removeAttr('href').text('磁链扫码');
9741003
$('#qrcode_download').removeAttr('href').text('种子扫码');
9751004
$('#qrcode_magnet_enlarged').attr('qr_content', magnet_url.full);
976-
$('#qrcode_download_enlarged').attr('qr_content', torrent_url.lite); var register_qrcode_event = function(sel, sel_enlarged) { $(sel).click(function() { $('.qrcode_enlarged').html('').hide();
977-
$(sel_enlarged).qrcode({ render: "canvas", size: 256, fill: '#0480BE', background: '#FFF', quiet: 1, mode: 2, minVersion: 10, label: $(sel_enlarged).attr('qr_label'), fontname: '"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif', fontcolor: 'darkorange', text: $(sel_enlarged).attr('qr_content') });
978-
$(sel_enlarged).fadeIn(200); });
979-
$(sel_enlarged).click(function() { $(this).hide(); }); };
980-
$(document).ready(function() { register_qrcode_event('#qrcode_magnet', '#qrcode_magnet_enlarged');
981-
register_qrcode_event('#qrcode_download', '#qrcode_download_enlarged'); }); } else if (Config['user_script']['platform'] == 'mobile') { $('#torrent_url').attr('href', torrent_url.full).text('种子下载').click(function() { return (prompt('确认下载该种子', torrent_url.full) ? true : false); });
982-
$('#magnet_url').attr('href', magnet_url.full).text('磁力下载').click(function() { return (prompt('确认下载磁链', magnet_url.full) ? true : false); }); } else { return false; }
983-
})(jQuery);
1005+
$('#qrcode_download_enlarged').attr('qr_content', torrent_url.lite);
1006+
var register_qrcode_event = function(sel, sel_enlarged) {
1007+
$(sel).click(function() {
1008+
$('.qrcode_enlarged').html('').hide();
1009+
$(sel_enlarged).qrcode({
1010+
render: "canvas",
1011+
size: 256,
1012+
fill: '#0480BE',
1013+
background: '#FFF',
1014+
quiet: 1,
1015+
mode: 2,
1016+
minVersion: 10,
1017+
label: $(sel_enlarged).attr('qr_label'),
1018+
fontname: '"Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif',
1019+
fontcolor: 'darkorange',
1020+
text: $(sel_enlarged).attr('qr_content')
1021+
});
1022+
$(sel_enlarged).fadeIn(200);
1023+
});
1024+
$(sel_enlarged).click(function() {
1025+
$(this).hide();
1026+
});
1027+
};
1028+
$(document).ready(function() {
1029+
register_qrcode_event('#qrcode_magnet', '#qrcode_magnet_enlarged');
1030+
register_qrcode_event('#qrcode_download', '#qrcode_download_enlarged');
1031+
});
1032+
} else if (Config['user_script']['platform'] == 'mobile') {
1033+
$('#torrent_url').attr('href', torrent_url.full).text('种子下载').click(function() {
1034+
return (prompt('确认下载该种子', torrent_url.full) ? true : false);
1035+
});
1036+
$('#magnet_url').attr('href', magnet_url.full).text('磁力下载').click(function() {
1037+
return (prompt('确认下载磁链', magnet_url.full) ? true : false);
1038+
});
1039+
} else {
1040+
return false;
1041+
}
1042+
})(unsafeWindow.jQuery);
9841043
}
985-
},
986-
{
1044+
}
1045+
/*{
9871046
name:"Reddit",
9881047
url:"https://www.reddit.com/r/SwitchNSPs",
9891048
regex:/reddit\.com/,
@@ -1018,7 +1077,7 @@
10181077
decodeBase64();
10191078
});
10201079
}
1021-
}
1080+
}*/
10221081
/*{
10231082
name:"咻咻动漫",
10241083
url:"http://www.xiu.moe/",

0 commit comments

Comments
 (0)