TJUPT Helper

TJUPT 辅种工具

  1. // ==UserScript==
  2. // @name TJUPT Helper
  3. // @namespace https://gf.qytechs.cn/scripts/445739
  4. // @version 1.2
  5. // @description TJUPT 辅种工具
  6. // @author xqm32
  7. // @include /^https?://www\.tjupt\.org/userdetails.php\?id=.*/
  8. // @icon none
  9. // @grant none
  10. // @require https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js
  11. // @require https://cdn.jsdelivr.net/npm/clipboard@2.0.10/dist/clipboard.min.js
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (function () {
  16. let getUserPassKey = function () {
  17. let passkey = $("#th-passkey").val();
  18. if (passkey.length == 0) passkey = "YOUR_PASSKEY";
  19. return passkey;
  20. };
  21.  
  22. let getUserID = function () {
  23. let url = new URL(window.location.href);
  24. return url.searchParams.get("id");
  25. };
  26.  
  27. let getTorrentList = async function (e, t, n) {
  28. const i = $(`#${n}`);
  29. console.log("getTorrentList");
  30. $("#th-copy").text(`获取中`);
  31. klappe_news(n.substr(1)),
  32. "加载中..." === i.html() &&
  33. (await $.get(
  34. "getusertorrentlistajax.php",
  35. {
  36. userid: e,
  37. type: t,
  38. },
  39. (e) => {
  40. i.html(e);
  41. }
  42. ));
  43. };
  44.  
  45. let showTorrentList = function (n) {
  46. $(`#${n} > table > tbody > tr:nth-child(1)`).append(
  47. `<td class="colhead" align="center">种子 ID</td>`
  48. );
  49. let trs = $(`#${n} > table > tbody > tr`);
  50. $("#th-copy").text(`点击复制获取的 ${trs.length - 1} 条记录`);
  51. let passkey = getUserPassKey();
  52. for (let i = 1; i < trs.length; ++i) {
  53. let href = $(trs[i]).find(`td[class="rowfollow"] > a`).attr("href");
  54. let url = new URL(window.location.origin + "/" + href);
  55. let id = url.searchParams.get("id");
  56. $(trs[i]).append(`<td class="rowfollow" align="center">${id}</td>`);
  57. $("#th-torrentList").append(
  58. `https://www.tjupt.org/download.php?id=${id}&passkey=${passkey}\n`
  59. );
  60. }
  61. };
  62.  
  63. $("#outer > table > tbody > tr > td > h2").after(
  64. `<button id="th-seeding">获取做种中种子</button>` +
  65. `<button id="th-completed">获取已完成种子</button>` +
  66. `<button id="th-copy" class="th-btn" data-clipboard-target="#th-torrentList">请先点击获取</button>` +
  67. `<label for="th-passkey">你的密钥(可选):</label>` +
  68. `<input id="th-passkey"/>` +
  69. `<br/>` +
  70. `<textarea id="th-torrentList" rows="5" style="width: 600px; height: 90px;"></textarea>`
  71. );
  72.  
  73. $("#th-seeding").click(() =>
  74. getTorrentList(getUserID(), "seeding", "ka1").then(() =>
  75. showTorrentList("ka1")
  76. )
  77. );
  78. $("#th-completed").click(() =>
  79. getTorrentList(getUserID(), "completed", "ka3").then(() =>
  80. showTorrentList("ka3")
  81. )
  82. );
  83.  
  84. new ClipboardJS(".th-btn");
  85. })();

QingJ © 2025

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