一键认领

一键认领种子

  1. // ==UserScript==
  2. // @name 一键认领
  3. // @name:en torrents claim
  4. // @namespace claim
  5. // @version 0.0.27
  6. // @description 一键认领种子
  7. // @description:en one key claim all the seeding torrents
  8. // @author Exception
  9. // @match *://hdtime.org/userdetails.php?id=*
  10. // @match *://hdvideo.one/userdetails.php?id=*
  11. // @match *://carpt.net/userdetails.php?id=*
  12. // @match *://1ptba.com/userdetails.php?id=*
  13. // @match *://hdatmos.club/userdetails.php?id=*
  14. // @match *://ptchina.org/userdetails.php?id=*
  15. // @match *://zmpt.cc//userdetails.php?id=*
  16. // @match *://hdmayi.com/userdetails.php?id=*
  17. // @match *://wintersakura.net/userdetails.php?id=*
  18. // @match *://pt.0ff.cc/userdetails.php?id=*
  19. // @match *://leaves.red/userdetails.php?id=*
  20. // @match *://wwww.leaves.red/userdetails.php?id=*
  21. // @match *://cyanbug.net/userdetails.php?id=*
  22. // @match *://pt.soulvoice.club/userdetails.php?id=*
  23. // @match *://piggo.me/userdetails.php?id=*
  24. // @match *://dajiao.cyou/userdetails.php?id=*
  25. // @match *://zmpt.cc/userdetails.php?id=*
  26. // @match *://hdfans.org/userdetails.php?id=*
  27. // @match *://discfan.net/userdetails.php?id=*
  28. // @match *://pandapt.net/userdetails.php?id=*
  29. // @match *://www.okpt.net/userdetails.php?id=*
  30. // @match *://ptvicomo.net/userdetails.php?id=*
  31. // @match *://*.agsvpt.com/userdetails.php?id=*
  32. // @match *://ubits.club/userdetails.php?id=*
  33. // @match *://share.ilolicon.com/userdetails.php?id=*
  34. // @match *://www.hdkyl.in/userdetails.php?id=*
  35. // @match *://www.icc2022.com/userdetails.php?id=*
  36. // @match *://kufei.org/userdetails.php?id=*
  37. // @match *://ptcafe.club/userdetails.php?id=*
  38. // @match *://public.ecustpt.eu.org/userdetails.php?id=*
  39. // @match *://new.qingwa.pro/userdetails.php?id=*
  40. // @match *://crabpt.vip/userdetails.php?id=*
  41.  
  42.  
  43. // @license MIT
  44. // @grant unsafeWindow
  45. // ==/UserScript==
  46.  
  47. /**
  48. * 改自大青虫一键认领, 原网址: https://gf.qytechs.cn/zh-CN/scripts/434757-烧包一键认领
  49. * 改自 https://gf.qytechs.cn/zh-CN/scripts/470045-%E4%B8%80%E9%94%AE%E8%AE%A4%E9%A2%86
  50. */
  51.  
  52. (function () {
  53. 'use strict';
  54. var host = window.location.host;
  55. var href = window.location.href;
  56. console.log("host:" + host)
  57. console.log("href:" + href)
  58. // Your code here...
  59. function sleep(time) {
  60. return new Promise((resolve) => setTimeout(resolve, time)).catch((e) => { console.log(e); });
  61. }
  62.  
  63. window.onload = function () {
  64. var rows = document.querySelectorAll("tr");//tr表行元素,获取所有表行
  65. for (var i = 0; i < rows.length; i++) {
  66. if (rows[i].childElementCount == 2 && rows[i].cells[0].innerText == "当前做种") {//如果该表行只有两个子元素且第一个子元素的内部文本为“当前做种”
  67. var idClaim = document.getElementById("claimAllTorrents");//获取所有ID为的claimAllTorrents的元素
  68. if (idClaim == null) {//如果为空,则创建一键认领按钮
  69. const dom = document.createElement('div')
  70. dom.innerHTML = '<a id="claimAllTorrents" href="javascript:void(0);" onclick="window.manualClaimTorrents();" style="margin-left:10px;font-weight:bold;color:red" title="认领全部当前做种(运行后无法停止,强制停止可关闭页面)">一键认领</a>';
  71. rows[i].cells[1].prepend(dom)
  72. break;
  73. }
  74. }
  75. }
  76. }
  77.  
  78. unsafeWindow.manualClaimTorrents = async function () {
  79. const _raw_list = Array.from(document.querySelectorAll("button[data-action='addClaim']"));
  80. const list = _raw_list.filter(el => el.style.display != 'none');//获取所有a元素
  81. console.log(list);
  82. if (list.length == 0) {
  83. alert('未检测到已做种种子或已经全部认领\n请打开当前做种列表, 若列表没有种子您无法认领!\n若您已经全部认领请无视!')
  84. return
  85. }
  86.  
  87. var msg = "确定要认领全部种子吗?\n\n严正警告: \n请勿短时间内多次点击, 否则后果自负!\n请勿短时间内多次点击, 否则后果自负!\n请勿短时间内多次点击, 否则后果自负! \n点击后请等待至弹窗, 种子越多越要等捏(每个种子访问间隔500ms)";
  88. if (confirm(msg) == true) {//提示选择确认
  89. //for (var i = 0; i < list.length; i++) {
  90. var maxClaim = 10000;
  91. var result = await unsafeWindow.ClassificationClaimTorrents(list, maxClaim);
  92. var total = result.total;
  93. var success = result.success;
  94. alert(`共计${total}个种子,本次成功认领${success}个。`);
  95. var idClaim = document.getElementById("claimAllTorrents");
  96. //翻页以后可以继续使用一键认领
  97. //idClaim.parentNode.removeChild(idClaim);
  98. //}
  99. }
  100. }
  101.  
  102. unsafeWindow.ClassificationClaimTorrents = async function (element, maxClaim) {
  103. var total = 0, success = 0;
  104.  
  105. for (const el of element) {
  106. if (success >= maxClaim) {
  107. alert("最多只能认领10000个种子!");
  108. break;
  109. }
  110.  
  111. total += 1
  112.  
  113. const claimId = el.dataset.torrent_id
  114. if (claimId > 0) {
  115. var xhr = new XMLHttpRequest();
  116. xhr.open('POST', 'https://'+host+'/ajax.php', true);
  117. xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  118. xhr.send('action=addClaim&params%5Btorrent_id%5D=' + claimId);
  119. }
  120.  
  121. xhr.onload = function () {
  122. if (xhr.status == 200) {
  123. // response 就是你要的东西
  124. var response = xhr.responseText
  125. el.style.background = 'lime';
  126. el.innerText = '成功';
  127.  
  128. // console.log(response)
  129.  
  130. success += 1;
  131. }
  132. }
  133.  
  134. await sleep(500);
  135. }
  136. return {
  137. total: total,
  138. success: success
  139. }
  140. }
  141. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址