Greasy Fork is available in English.

Highlight Top 3 Torrents and Hide Lossy Torrents on RED and OPS.

Colors of Top 3 are green, blue, orange.

  1. // ==UserScript==
  2. // @name Highlight Top 3 Torrents and Hide Lossy Torrents on RED and OPS.
  3. // @namespace userscript1
  4. // @match http*://*redacted.ch/torrents.php*id=*
  5. // @match http*://*orpheus.network/torrents.php*id=*
  6. // @version 0.1
  7. // @description Colors of Top 3 are green, blue, orange.
  8. // ==/UserScript==
  9.  
  10. (function () {
  11. document
  12. .querySelectorAll("tr.torrent_row, tr.group_torrent")
  13. .forEach((a) => check(a));
  14.  
  15. function check(a) {
  16. if (a.querySelector(".edition_info") || a.textContent.includes("Lossless"))
  17. return;
  18.  
  19. a.parentNode.removeChild(a);
  20. }
  21.  
  22. let alltorrents = [];
  23.  
  24. let torrentlist = document.querySelectorAll(
  25. "tr.torrent_row, tr.group_torrent"
  26. );
  27.  
  28. for (let [_, val] of torrentlist.entries()) {
  29.  
  30. let selector = val.querySelector("td:nth-child(4)");
  31.  
  32. if (selector != null) {
  33. // console.log(val.querySelector("td:nth-child(4)").innerText)
  34. alltorrents.push({
  35. seed_count: selector.innerText,
  36. parent_id: selector.parentElement.id,
  37. });
  38. }
  39. }
  40.  
  41. let [first, second, third] = alltorrents.sort(
  42. (a, b) => b.seed_count - a.seed_count
  43. );
  44.  
  45. function setColor(id, color, index) {
  46. let ele = document.getElementById(id);
  47. ele.style.backgroundColor = color;
  48.  
  49. // console.log(`%c${ele.previousElementSibling.innerText}`, `color:${color}; font-size: ${20 - index * 2}px;`)
  50. }
  51.  
  52. setColor(first.parent_id, "rgb(22 101 52 / 25%)", 1)
  53. setColor(second.parent_id, "rgb(29 78 216 / 16%)", 2)
  54. setColor(third.parent_id, "rgb(180 83 9 / 18%)", 3)
  55.  
  56. })();