Greasy Fork

Greasy Fork is available in English.

Remove Seeding

1/23/24 Adds a button to remove seeding torrents from Search views (Handy to zip the rest for download)

当前为 2024-01-23 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name Remove Seeding
// @namespace    yyyzzz999
// @author       yyyzzz999
// @description  1/23/24 Adds a button to remove seeding torrents from Search views (Handy to zip the rest for download)
// @match        https://www.myanonamouse.net/tor/browse.php*
// @version      0.1
// @icon         https://www.myanonamouse.net/pic/smilies/yesmaster.gif
// @homepage     http://greasyfork.icu/en/users/705546-yyyzzz999

// @license      MIT
// @grant        none
// ==/UserScript==
/*jshint esversion: 11 */
/*eslint no-multi-spaces:0 */
(function() {
'use strict';

var DEBUG =1; // Debugging mode on (1) or off (0)
if (DEBUG > 0) console.log('Starting Remove Seeding script');
// debugger
// Create the button
const button = document.createElement("button");
button.textContent = "Remove Seeding Rows";
let el = document.querySelector("div.blockFoot");
var span = document.createElement('span');
// span.textContent = " - " ;
// el.appendChild(span);
el.appendChild(button);
// Add a click event listener to the button
button.addEventListener("click", function() {
// Get all table rows
const rows = document.getElementsByTagName("tr");
    if (DEBUG > 0) console.log(`rows.length: ${rows.length}`);
// Loop through all rows
for (let i = rows.length - 1; i >= 0; i--) { //We have to start at the last row, otherwise removing a row skips checking the next row.
  const row = rows[i];
  const cells = row.getElementsByTagName("td");
  let removeRow = false;
  if (DEBUG > 0) console.log(`i: ${i}`);
  // Loop through all cells in the row
  for (let j = 0; j < cells.length; j++) { //shorten this later...
    const cell = cells[j];

    // Check if the cell contains PF
    if (cell.innerHTML.includes('<div class="browseAct">Recently Seeding in&nbsp;your Client</div>')) {
      removeRow = true;
      break;
    }
  }

  // Hide the row if it doesn't contain the target element
  if (removeRow) {
   // row.style.display = "none";
      row.remove();
      if (DEBUG > 0) console.log(`i: ${i} Removed`);
  }
}
}); // End hide function

//    var headDiv = document.querySelector('div.blockHeadCon');
//      headDiv.appendChild(button); //Doesn't work, moves the first button instead of duplicates it.

if (DEBUG > 0) console.log('Remove Seeding script done.');

})();