Skip to content

Commit 0e34732

Browse files
committed
add miobt
1 parent 5311711 commit 0e34732

1 file changed

Lines changed: 103 additions & 1 deletion

File tree

HacgGodTurn/HacgGodTurn.user.js

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
// @include http*://www.xiu.moe/*
9393
// @include http*://www.cld1.net/*
9494
// @include http*://sjhs*.*
95+
// @include http*://*comicat.*
96+
// @include http*://*kisssub.*
97+
// @include http*://*miobt.*
9598
// @include http*://www.dakashangche.*
9699
// @include http*://xiuxiqu.xyz*
97100
// @include http*://sleazyfork.org/*/scripts/*
@@ -594,7 +597,7 @@
594597
var a = this.match(reg);
595598
return a? [a.slice(1,a.length)] : 0;
596599
}
597-
var a=[],b;
600+
a=[],b;
598601
while(b=reg.exec(this)){
599602
b.shift();
600603
a.push(b);
@@ -862,6 +865,105 @@
862865
offset:55,
863866
downloadUrl:/\/\?download\?id=/,
864867
articleSel:"section.card"
868+
},
869+
{
870+
name:"爱恋动漫",
871+
url:"http://kisssub.org/",
872+
regex:/kisssub\./,
873+
run:function(){
874+
var acgscript_config = { "miobt": { "4": { "api_url": "http://v2.uploadbt.com" } } };
875+
(function($) {
876+
if (acgscript_config['miobt']['4']['loaded']) { return false; }
877+
acgscript_config['miobt']['4']['loaded'] = true;
878+
var log_name = 'bt_download';
879+
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'] }]);
880+
if (!Config['mika_mode']['enabled']) { return false; }
881+
if (Config['in_script'] !== 'show') { return false; }
882+
if (!$('#box_download')) { return false; }
883+
var api_url = acgscript_config['miobt']['4']['api_url'];
884+
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']) };
885+
var magnet_url = { 'lite': 'magnet:?xt=urn:btih:' + Config['hash_id'], 'full': 'magnet:?xt=urn:btih:' + Config['hash_id'] + '&tr=' + Config['announce'] };
886+
if (Config['user_script']['platform'] == 'desktop') { $('#box_download h2.title').text('下载地址');
887+
$('#magnet').attr('href', magnet_url.full).text('磁链下载');
888+
$('#download').attr('href', torrent_url.full).text('种子下载');
889+
$('#qrcode_magnet').removeAttr('href').text('磁链扫码');
890+
$('#qrcode_download').removeAttr('href').text('种子扫码');
891+
$('#qrcode_magnet_enlarged').attr('qr_content', magnet_url.full);
892+
$('#qrcode_download_enlarged').attr('qr_content', torrent_url.lite); var register_qrcode_event = function(sel, sel_enlarged) { $(sel).click(function() { $('.qrcode_enlarged').html('').hide();
893+
$(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') });
894+
$(sel_enlarged).fadeIn(200); });
895+
$(sel_enlarged).click(function() { $(this).hide(); }); };
896+
$(document).ready(function() { register_qrcode_event('#qrcode_magnet', '#qrcode_magnet_enlarged');
897+
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); });
898+
$('#magnet_url').attr('href', magnet_url.full).text('磁力下载').click(function() { return (prompt('确认下载磁链', magnet_url.full) ? true : false); }); } else { return false; }
899+
})(jQuery);
900+
}
901+
},
902+
{
903+
name:"MioBT",
904+
url:"http://miobt.com/",
905+
regex:/miobt\./,
906+
run:function(){
907+
var acgscript_config = { "miobt": { "4": { "api_url": "http://v2.uploadbt.com" } } };
908+
(function($) {
909+
if (acgscript_config['miobt']['4']['loaded']) { return false; }
910+
acgscript_config['miobt']['4']['loaded'] = true;
911+
var log_name = 'bt_download';
912+
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'] }]);
913+
if (!Config['mika_mode']['enabled']) { return false; }
914+
if (Config['in_script'] !== 'show') { return false; }
915+
if (!$('#box_download')) { return false; }
916+
var api_url = acgscript_config['miobt']['4']['api_url'];
917+
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']) };
918+
var magnet_url = { 'lite': 'magnet:?xt=urn:btih:' + Config['hash_id'], 'full': 'magnet:?xt=urn:btih:' + Config['hash_id'] + '&tr=' + Config['announce'] };
919+
if (Config['user_script']['platform'] == 'desktop') { $('#box_download h2.title').text('下载地址');
920+
$('#magnet').attr('href', magnet_url.full).text('磁链下载');
921+
$('#download').attr('href', torrent_url.full).text('种子下载');
922+
$('#qrcode_magnet').removeAttr('href').text('磁链扫码');
923+
$('#qrcode_download').removeAttr('href').text('种子扫码');
924+
$('#qrcode_magnet_enlarged').attr('qr_content', magnet_url.full);
925+
$('#qrcode_download_enlarged').attr('qr_content', torrent_url.lite); var register_qrcode_event = function(sel, sel_enlarged) { $(sel).click(function() { $('.qrcode_enlarged').html('').hide();
926+
$(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') });
927+
$(sel_enlarged).fadeIn(200); });
928+
$(sel_enlarged).click(function() { $(this).hide(); }); };
929+
$(document).ready(function() { register_qrcode_event('#qrcode_magnet', '#qrcode_magnet_enlarged');
930+
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); });
931+
$('#magnet_url').attr('href', magnet_url.full).text('磁力下载').click(function() { return (prompt('确认下载磁链', magnet_url.full) ? true : false); }); } else { return false; }
932+
})(jQuery);
933+
}
934+
},
935+
{
936+
name:"漫猫",
937+
url:"http://comicat.org/",
938+
regex:/comicat\./,
939+
run:function(){
940+
var acgscript_config = { "miobt": { "4": { "api_url": "http://v2.uploadbt.com" } } };
941+
(function($) {
942+
if (acgscript_config['miobt']['4']['loaded']) { return false; }
943+
acgscript_config['miobt']['4']['loaded'] = true;
944+
var log_name = 'acgscript/miobt/bt_download';
945+
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'] }]);
946+
if (!Config['mika_mode']['enabled']) { return false; }
947+
if (Config['in_script'] !== 'show') { return false; }
948+
if (!$('#box_download')) { return false; }
949+
var api_url = acgscript_config['miobt']['4']['api_url'];
950+
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']) };
951+
var magnet_url = { 'lite': 'magnet:?xt=urn:btih:' + Config['hash_id'], 'full': 'magnet:?xt=urn:btih:' + Config['hash_id'] + '&tr=' + Config['announce'] };
952+
if (Config['user_script']['platform'] == 'desktop') { $('#box_download h2.title').text('下载地址');
953+
$('#magnet').attr('href', magnet_url.full).text('磁链下载');
954+
$('#download').attr('href', torrent_url.full).text('种子下载');
955+
$('#qrcode_magnet').removeAttr('href').text('磁链扫码');
956+
$('#qrcode_download').removeAttr('href').text('种子扫码');
957+
$('#qrcode_magnet_enlarged').attr('qr_content', magnet_url.full);
958+
$('#qrcode_download_enlarged').attr('qr_content', torrent_url.lite); var register_qrcode_event = function(sel, sel_enlarged) { $(sel).click(function() { $('.qrcode_enlarged').html('').hide();
959+
$(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') });
960+
$(sel_enlarged).fadeIn(200); });
961+
$(sel_enlarged).click(function() { $(this).hide(); }); };
962+
$(document).ready(function() { register_qrcode_event('#qrcode_magnet', '#qrcode_magnet_enlarged');
963+
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); });
964+
$('#magnet_url').attr('href', magnet_url.full).text('磁力下载').click(function() { return (prompt('确认下载磁链', magnet_url.full) ? true : false); }); } else { return false; }
965+
})(jQuery);
966+
}
865967
}
866968
/*{
867969
name:"咻咻动漫",

0 commit comments

Comments
 (0)