Greasy Fork is available in English.

@@PT-site-helper

PT-site-helper PT 助手,高亮 Free 帖子,自动签到

  1. // ==UserScript==
  2. // @name @@PT-site-helper
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.9
  5. // @description PT-site-helper PT 助手,高亮 Free 帖子,自动签到
  6. // @author You
  7. // @match *://hdhome.org/torrents*
  8. // @match https://*.m-team.cc/*
  9. // @match *://*.beitai.pt/torrents.php*
  10. // @match *://pter.club/*
  11. // @match https://ourbits.club/*
  12. // @match https://nanyangpt.com/*
  13. // @match *://pt.btschool.club/*
  14. // @match *://leaguehd.com/*
  15. // @match *://pterclub.com/torrents.php*
  16. // @match https://pt.gztown.net/torrents.php*
  17. // @match https://www.nicept.net/torrents.php*
  18. // @match https://www.pthome.net/torrents.php*
  19. // @match http://www.hdscg.cc/torrents.php*
  20. // @match https://www.hdarea.co/torrents.php*
  21. // @require https://cdn.staticfile.org/jquery/1.12.2/jquery.min.js
  22. // @require https://greasyfork.org/scripts/373955-secretlyrequest/code/secretlyRequest.js?version=642317
  23. // @grant none
  24. // ==/UserScript==
  25.  
  26. (function() {
  27. 'use strict';
  28.  
  29. // Your code here...
  30. var url = window.location.origin;
  31. var fullurl = window.location.href;
  32.  
  33. $('body, table, .torrents td').css({
  34. "background-color": "#efefef",
  35. "color": "#000"
  36. });
  37. $('table a').css('color', 'blue');
  38. var allFitStyle = `<style>
  39. .ddiframeshim { height:0!important; }
  40. .torrents>tbody>tr:hover td { background: #ddd !important; }
  41. </style>`;
  42. $('head').append(allFitStyle);
  43. if (window.location.href.includes('m-team.cc/details')) {
  44. $('head').append(`<style>
  45. .mainouter img {width: auto !important; height: auto !important;}
  46. </style>`);
  47. }
  48.  
  49. setTimeout(function() {
  50. var $qiandao1 = $('#nav_block a.faqlink');
  51. var $qiandao2 = $('#outer a[href="index.php?action=addbonus"]');
  52. var $qiandao3 = $('#sign_in a');
  53. if ($qiandao1.length) {
  54. window.H.secretlyRequest($qiandao1.attr('href')).then((err) => {
  55. if (!err) $qiandao1.remove();
  56. });
  57. }
  58. if ($qiandao2.length) {
  59. window.H.secretlyRequest($qiandao2.attr('href')).then((err) => {
  60. if (!err) $qiandao1.remove();
  61. });
  62. }
  63. if ($qiandao3.length) {
  64. $qiandao3.click();
  65. }
  66. }, 2000);
  67.  
  68. function insertButton(btnName) {
  69. var btn = `<button id="fn1"
  70. style="position: fixed; left: 10px; top: 10px; z-index: 9999; background: #fff; border: 1px solid #aaa; padding: 4px 10px;"
  71. >${btnName}</button>`;
  72.  
  73. $('body').append(btn);
  74. $('#fn1').on('click', function () {
  75. start();
  76. });
  77. }
  78.  
  79. function start() {
  80. var $free = $('.pro_free');
  81. var $free2 = $('.pro_free2up');
  82.  
  83. var background = 'background: rgb(255, 222, 144, 1) !important';
  84. $.each($free, (index, item) => {
  85. if (fullurl.indexOf('pter') > -1) {
  86. $(item).parent().parent().attr('style', background);
  87. } else {
  88. $(item).parent().attr('style', background);
  89. }
  90. });
  91. $.each($free2, (index, item) => {
  92. $(item).parent().attr('style', background);
  93. });
  94. }
  95.  
  96. insertButton('高亮Free');
  97.  
  98. if (url.indexOf('gztown.net') > -1) {
  99. var style = `<style>
  100. img { display:none; }
  101. body,table { background-color: #fff !important; }
  102. .sticky_normal { background: #fff !important; }
  103. </style>`;
  104. $('head').append(style);
  105. }
  106.  
  107. // show https ipv4 link
  108. if (fullurl.indexOf('.m-team.cc/details.php') > -1) {
  109. var $link = $("a:contains('[IPv4+https]')");
  110. var ahref = $link.attr('href');
  111. var urlTxt = url + ahref;
  112. var $td = $link.parent().parent();
  113. $td.prepend([
  114. '<input id="downloadurl" value="'+ urlTxt +'" style="width:700px">',
  115. '<span id="downloadurlinfo" style="color: #f60;"></span>',
  116. '<br><br>'
  117. ].join(''));
  118. $('body').on('click', '#downloadurl', function () {
  119. document.querySelector('#downloadurl').select();
  120. $('#downloadurlinfo').html('');
  121. if (document.execCommand('copy')) {
  122. document.execCommand('copy');
  123. $('#downloadurlinfo').html('复制成功');
  124. }
  125. })
  126. }
  127. // shot
  128. if (fullurl.indexOf('.m-team.cc/torrents.php') > -1 || fullurl.indexOf('.m-team.cc/adult.php') > -1 || fullurl.indexOf('.m-team.cc/movie.php') > -1) {
  129. var insertSelector = function () {
  130. var sl = `<span style="position: fixed; left: 10px; top: 40px; z-index: 9999; background: #fff; border: 1px solid #aaa; padding: 4px 10px;"><select class="thumb-sl">
  131. <option value ="1">原始缩略图</option>
  132. <option value ="2">中号缩略图</option>
  133. <option value ="3">大号缩略图</option>
  134. </select></span>`
  135. $('body').append(sl);
  136. };
  137. var setSize = function(size) {
  138. var _s = size || '1';
  139. var heights = {
  140. '1': '43px',
  141. '2': '120px',
  142. '3': '280px'
  143. };
  144. $('td.torrentimg img').css({
  145. maxWidth: _s == 1 ? '75px' : 'none',
  146. height: heights[_s],
  147. });
  148. };
  149. var lis = function() {
  150. var $sl = $('.thumb-sl');
  151. $sl.on('change', function() {
  152. console.log(this.value);
  153. setSize(this.value);
  154. });
  155. };
  156. insertSelector();
  157. lis();
  158. }
  159.  
  160. if (fullurl.indexOf('ourbits.club/details.php') > -1) {
  161. var $link = $("a:contains('[下载地址]')");
  162. var ahref = $link.attr('href');
  163. var urlTxt = window.location.origin + ahref;
  164. var $td = $link.parent();
  165. $td.prepend([
  166. '<input id="downloadurl" value="'+ urlTxt +'" style="width:700px">',
  167. '<span id="downloadurlinfo" style="color: #f60;"></span>',
  168. '<br><br>'
  169. ].join(''));
  170. $('body').on('click', '#downloadurl', function () {
  171. document.querySelector('#downloadurl').select();
  172. $('#downloadurlinfo').html('');
  173. if (document.execCommand('copy')) {
  174. document.execCommand('copy');
  175. $('#downloadurlinfo').html('复制成功');
  176. }
  177. })
  178. }
  179.  
  180. if (fullurl.indexOf('hdhome.org/details.php') > -1) {
  181. var $link = $("a:contains('请右键复制链接')");
  182. var ahref = $link.attr('href');
  183. var urlTxt = ahref;
  184. var $td = $link.parent();
  185. $td.prepend([
  186. '<input id="downloadurl" value="'+ urlTxt +'" style="width:700px">',
  187. '<span id="downloadurlinfo" style="color: #f60;"></span>',
  188. '<br><br>'
  189. ].join(''));
  190. $('body').on('click', '#downloadurl', function () {
  191. document.querySelector('#downloadurl').select();
  192. $('#downloadurlinfo').html('');
  193. if (document.execCommand('copy')) {
  194. document.execCommand('copy');
  195. $('#downloadurlinfo').html('复制成功');
  196. }
  197. })
  198. }
  199. })();