Sleazy Fork is available in English.

SIS download seeds

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

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
  1. // ==UserScript==
  2. // @name SIS download seeds
  3. // @namespace websiteEnhancement
  4. // @author jimmly
  5. // @version 2024.9.6
  6. // @description 增加页面顶部底部按钮和一键下种按钮
  7. // @create 2023-9-21
  8. // @include *sis001*
  9. // @grant GM_getValue
  10. // @grant GM_setValue
  11. // @grant GM.getValue
  12. // @grant GM.setValue
  13. // @license MIT
  14. // @run-at document-start
  15. // ==/UserScript==
  16.  
  17. (async function (loadJQuery) {
  18. loadJQuery(window).then(([$, win]) => {
  19. ["https://cdn.jsdelivr.net/gh/sodiray/radash@master/cdn/radash.min.js",
  20. "https://update.greasyfork.org/scripts/483173/1301961/GM_config_cnjames.js",
  21. "https://update.sleazyfork.org/scripts/476583/common_libs_of_array.js",
  22. "https://update.sleazyfork.org/scripts/513894/1470715/remove%20ads%20lib.js"
  23. ].reduce((p, url) => p.then(() => new Promise((resolve, reject) => $.getScript(url).done(() => resolve()).fail(() => reject()))), Promise.resolve())
  24. .then(v => {
  25. remove_adds($, window)
  26. $('table a').removeAttr('style')
  27.  
  28. win.funcDownload = function () {
  29. let url = $(".t_attachlist > dt > a:eq(1)").prop('href');
  30. let filename = $("div.mainbox.viewthread>h1").text().trim() + '.torrent';
  31. console.log(filename)
  32. $.ajax({
  33. url,
  34. success: function (result, status, xhr) {
  35. createSuperLabel(
  36. $(result).find("#downloadBtn").prop('href'),
  37. $(result).find("#downloadBtn").prop('href'),
  38. filename)
  39. // let alink = document.createElement('a');
  40. // alink.download = filename;
  41. // alink.href = $(result).find("#downloadBtn").prop('href');
  42. // document.body.appendChild(alink);
  43. // alink.click();
  44. },
  45. error: function (xhr, status, error) {
  46. console.log(status, error)
  47. }
  48. });
  49. }
  50. win.funcList = function (container) { }
  51. win.funcDetail = function (container) { }
  52. const reg = /.*(\d{8}).*/
  53.  
  54. win.__compareKey = function (cache, curr) {
  55. if (cache === curr)
  56. return true
  57. ///thread-6638382-
  58. if (reg.test(cache))
  59. return cache.replace(reg, "$1") === curr
  60. return false
  61. }
  62. win.fixValue = function (value) {
  63. if (reg.test(value))
  64. return value.replace(reg, "$1")
  65. return value
  66. }
  67.  
  68.  
  69. autoFind(() => win.location.href.indexOf('thread') == -1, 'sis', 'span>a', el => el.text(), $, {}, win, funcDownload, funcList, funcDetail);
  70.  
  71.  
  72. })
  73. })
  74.  
  75. })(function (unsafeWindow) {
  76. return new Promise((resolve, reject) => {
  77. let dollar
  78. if (typeof $ != "undefined")
  79. dollar = $
  80. if (typeof jQuery == "undefined") {
  81. let script = document.createElement("script")
  82. script.type = "text/javascript"
  83. script.src = "https://code.jquery.com/jquery-3.7.1.min.js"
  84. script.onerror = function () {
  85. reject(new Error("Failed to load jQuery"))
  86. }
  87. script.addEventListener("load", function () {
  88. jQuery.noConflict()
  89. if (dollar) $ = dollar;
  90. resolve([jQuery, window ?? unsafeWindow])
  91. })
  92.  
  93. document.head.appendChild(script)
  94. }
  95. else {
  96. setTimeout(function () {
  97. // Firefox supports
  98. if (dollar) $ = dollar;
  99. resolve([jQuery, window ?? unsafeWindow])
  100. }, 30)
  101. }
  102. })
  103. });