Filelist filter

Custom Filelist filter for TV series and number of downloads

  1. // ==UserScript==
  2. // @name Filelist filter
  3. // @description Custom Filelist filter for TV series and number of downloads
  4. // @include https://filelist.io/*
  5. // @version 0.0.1.20230807194255
  6. // @namespace https://gf.qytechs.cn/users/162242
  7. // ==/UserScript==
  8.  
  9. var wordListing = [
  10. "Fear.the.Walking.Dead.S",
  11. "Foundation",
  12. "Halo",
  13. "House of the Dragon",
  14. "I.Am.Groot",
  15. "Invasion",
  16. "Loki",
  17. "Raised.by.Wolves",
  18. "Severance",
  19. "South.Park",
  20. "The.Boys",
  21. "The.Last.of.Us",
  22. "The.Lord.of.the.Rings.The.Rings.of.Power",
  23. "The.Sandman",
  24. "The.Terminal.List",
  25. "The.Walking.Dead",
  26. "The.Witcher.S"
  27. ];
  28.  
  29.  
  30. var selection1 = 500;
  31. var selection2 = 999;
  32. var selection3 = 1999;
  33. var selectionColor1 = "#003366";
  34. var selectionColor2 = "#002900";
  35. var selectionColor3 = "#6B0000";
  36.  
  37. var ul = document.getElementById("nav").children[0];
  38. var li = document.createElement('li');
  39. li.className = "fleft";
  40. ul.appendChild(li);
  41. var a = document.createElement('a');
  42. var linkText = document.createTextNode("Activate");
  43. a.appendChild(linkText);
  44. a.title = "Activate the filter";
  45. a.href = "javascript:void(0)";
  46. a.setAttribute("id", "CustomButton");
  47. a.addEventListener("click", myScript);
  48. li.appendChild(a);
  49.  
  50. function myScript() {
  51. var torrentrow = document.getElementsByClassName("torrentrow");
  52. if(document.getElementById("CustomButton").innerHTML == "Activate") {
  53. document.getElementById("CustomButton").innerHTML = "Deactivate";
  54.  
  55. for (i = 0; i < torrentrow.length; i++) {
  56. if(typeof torrentrow[i].children !== 'undefined'){
  57. var title = torrentrow[i].children[1].children[0].children[0].innerText;
  58. var snatched = torrentrow[i].children[7].children[0].children[0].textContent;
  59. snatched = snatched.replace(",", "");
  60. snatched = snatched.replace("times", "");
  61. snatched = parseInt(snatched);
  62. for (k = 0; k < wordListing.length; k++) {
  63. if (title.match(wordListing[k])) {
  64. torrentrow[i].children[1].children[0].children[0].style.textDecoration = "underline overline";
  65. torrentrow[i].children[1].children[0].children[0].style.color = "#33CCFF";
  66. }
  67. }
  68. if (snatched > selection3) {
  69. torrentrow[i].style.backgroundColor = selectionColor3;
  70. } else if (snatched > selection2) {
  71. torrentrow[i].style.backgroundColor = selectionColor2;
  72. } else if (snatched > selection1) {
  73. torrentrow[i].style.backgroundColor = selectionColor1;
  74. }
  75. }
  76. }
  77. } else {
  78. document.getElementById("CustomButton").innerHTML = "Activate";
  79. for (j = 0; j < torrentrow.length; j++) {
  80. torrentrow[j].children[1].children[0].children[0].style.textDecoration = "none";
  81. torrentrow[j].removeAttribute("style");
  82. torrentrow[j].children[1].children[0].children[0].removeAttribute("style");
  83. }
  84. }
  85. }
  86. document.addEventListener('DOMContentLoaded',myScript());

QingJ © 2025

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