// ==UserScript==
// @name @@PT-site-helper
// @namespace http://tampermonkey.net/
// @version 1.1
// @description PT-site-helper PT 助手
// @author You
// @match http://hdhome.org/*
// @match https://tp.m-team.cc/*
// @match https://ourbits.club/*
// @match https://nanyangpt.com/*
// @match https://pt.btschool.net/*
// @match https://pt.gztown.net/torrents.php*
// @match https://www.hdarea.co/torrents.php*
// @require https://cdn.staticfile.org/jquery/1.12.2/jquery.min.js
// @require https://greasyfork.org/scripts/373955-secretlyrequest/code/secretlyRequest.js?version=642317
// @grant none
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
var url = window.location.origin;
var fullurl = window.location.href;
$('body, table, .torrents td').css({
"background-color": "#efefef",
"color": "#000"
});
$('table a').css('color', 'blue');
var allFitStyle = ``;
$('head').append(allFitStyle);
setTimeout(function() {
var $qiandao1 = $('#nav_block a.faqlink');
var $qiandao2 = $('#outer a[href="index.php?action=addbonus"]');
var $qiandao3 = $('#sign_in a');
if ($qiandao1.length) {
window.H.secretlyRequest($qiandao1.attr('href')).then((err) => {
if (!err) $qiandao1.remove();
});
}
if ($qiandao2.length) {
window.H.secretlyRequest($qiandao2.attr('href')).then((err) => {
if (!err) $qiandao1.remove();
});
}
if ($qiandao3.length) {
$qiandao3.click();
}
}, 2000);
function insertButton(btnName) {
var btn = ``;
$('body').append(btn);
$('#fn1').on('click', function () {
start();
});
}
function start() {
var $free = $('.pro_free');
$.each($free, (index, item) => {
// var $tr = $(item).parents('.sticky_top');
console.log($(item).parent());
// $tr.find('td').css('background', 'red');
$(item).parent().attr('style', 'background: orange !important');
});
}
insertButton('高亮Free');
if (url.indexOf('gztown.net') > -1) {
var style = ``;
$('head').append(style);
}
// show https ipv4 link
if (fullurl.indexOf('tp.m-team.cc/details.php') > -1) {
var $link = $("a:contains('[IPv4+https]')");
var ahref = $link.attr('href');
var urlTxt = url + ahref;
var $td = $link.parent().parent();
$td.prepend([
'',
'',
'
'
].join(''));
$('body').on('click', '#downloadurl', function () {
document.querySelector('#downloadurl').select();
$('#downloadurlinfo').html('');
if (document.execCommand('copy')) {
document.execCommand('copy');
$('#downloadurlinfo').html('复制成功');
}
})
}
if (fullurl.indexOf('ourbits.club/details.php') > -1) {
var $link = $("a:contains('[下载地址]')");
var ahref = $link.attr('href');
var urlTxt = window.location.origin + ahref;
var $td = $link.parent();
$td.prepend([
'',
'',
'
'
].join(''));
$('body').on('click', '#downloadurl', function () {
document.querySelector('#downloadurl').select();
$('#downloadurlinfo').html('');
if (document.execCommand('copy')) {
document.execCommand('copy');
$('#downloadurlinfo').html('复制成功');
}
})
}
if (fullurl.indexOf('hdhome.org/details.php') > -1) {
var $link = $("a:contains('请右键复制链接')");
var ahref = $link.attr('href');
var urlTxt = ahref;
var $td = $link.parent();
$td.prepend([
'',
'',
'
'
].join(''));
$('body').on('click', '#downloadurl', function () {
document.querySelector('#downloadurl').select();
$('#downloadurlinfo').html('');
if (document.execCommand('copy')) {
document.execCommand('copy');
$('#downloadurlinfo').html('复制成功');
}
})
}
})();