Sleazy Fork is available in English.

wkgo download seeds

增加页面顶部底部按钮和一键下种按钮

  1. // ==UserScript==
  2. // @name wkgo download seeds
  3. // @namespace websiteEnhancement
  4. // @author You
  5. // @version 2024.9.12
  6. // @description 增加页面顶部底部按钮和一键下种按钮
  7. // @create 2023-9-21
  8. // @include *tianmao123.xyz*
  9. // @include *meituan123.xyz*
  10. // @include *wk2024.xyz*
  11. // @grant GM_getValue
  12. // @grant GM_setValue
  13. // @grant GM.getValue
  14. // @grant GM.setValue
  15. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  16. // @license MIT
  17. // @run-at document-start
  18. // ==/UserScript==
  19. ;
  20. (async function (loadJQuery) {
  21. Array.prototype.push = function (...items) {
  22. let len = this.length >>> 0;
  23. let argCount = items.length >>> 0;
  24. if (len + argCount > 2 ** 53 - 1) {
  25. throw new TypeError("Invalid array length");
  26. }
  27. for (let i = 0; i < argCount; i++) {
  28. this[len + i] = items[i];
  29. }
  30. this.length = len + argCount;
  31. return this.length;
  32. };
  33. loadJQuery(window).then(([$, win]) => {
  34. ["https://cdn.jsdelivr.net/gh/sodiray/radash@master/cdn/radash.min.js",
  35. "https://update.greasyfork.org/scripts/483173/1301961/GM_config_cnjames.js",
  36. "https://update.sleazyfork.org/scripts/476583/common_libs_of_array.js",
  37. "https://update.sleazyfork.org/scripts/513894/1470715/remove%20ads%20lib.js"
  38. ].reduce((p, url) => p.then(() => new Promise((resolve, reject) => $.getScript(url).done(() => resolve()).fail(() => reject()))), Promise.resolve())
  39. .then(v => {
  40. remove_adds($, window)
  41.  
  42. win.funcDownload = function () {
  43. $("a:contains(.torrent)").each((i, element) => {
  44. submit(function (next) {
  45. try {
  46. let url = $(element).attr('href');
  47. let filename = $(element).text().trim();
  48. if (filename.indexOf('torrent') > -1)
  49. {
  50. console.log("download file name:", $(element).text())
  51. createSuperLabel(url, url, filename, win)
  52. }
  53. }
  54. finally {
  55. setTimeout(function () { next() }, win.gmc.holdOn ?? 1000)
  56. }
  57. }, $)
  58. });
  59. submit(function (next) {
  60. if (localStorage.getItem("autoclosewindow") == 'Auto') {
  61. win.clearTimeout(win.closeTimer)
  62. win.closeTimer = setTimeout(function () {
  63. win.open("about:blank", "_self").close()
  64. }, 100)
  65. }
  66. next()
  67. }, $)
  68. }
  69. win.funcList = function () { }
  70. win.funcDetail = function () { }
  71. const reg = /(\d{6,})/
  72. win.__compareKey = function (cache, curr) {
  73. if (cache === curr)
  74. return true
  75. ///thread-6638382-
  76. let result = reg.exec(cache)
  77. if (result && result.length > 1)
  78. return result[1] === curr
  79. return false
  80. }
  81. win.fixValue = function (value) {
  82. let result = reg.exec(value)
  83. if (result && result.length > 1)
  84. return result[1]
  85. return value
  86. }
  87. $('table a').removeAttr('style')
  88.  
  89. autoFind(() => /wk2024.xyz\/forum[-\d]*.html/.test(win.location.href) || /wk2024.xyz\/forum.php\?mod=forumdisplay/.test(win.location.href), 'wk2024', 'a.s.xst', el => el.text(), $, {}, win, funcDownload, funcList, funcDetail);
  90.  
  91. })
  92. })
  93.  
  94. })(function (unsafeWindow) {
  95. return new Promise((resolve, reject) => {
  96. let dollar
  97. if (typeof $ != "undefined")
  98. dollar = $
  99. if (typeof jQuery == "undefined") {
  100. let script = document.createElement("script")
  101. script.type = "text/javascript"
  102. script.src = "https://code.jquery.com/jquery-3.7.1.min.js"
  103. script.onerror = function () {
  104. reject(new Error("Failed to load jQuery"))
  105. }
  106. script.addEventListener("load", function () {
  107. jQuery.noConflict()
  108. if (dollar) $ = dollar;
  109. resolve([jQuery, window ?? unsafeWindow])
  110. })
  111.  
  112. document.head.appendChild(script)
  113. }
  114. else {
  115. setTimeout(function () {
  116. // Firefox supports
  117. if (dollar) $ = dollar;
  118. resolve([jQuery, window ?? unsafeWindow])
  119. }, 30)
  120. }
  121. })
  122. });