Twitch Hide Viewer Bots

Hide bots from viewers list in Twitch (bot data from twitchinsights.net)

  1. // ==UserScript==
  2. // @name Twitch Hide Viewer Bots
  3. // @description Hide bots from viewers list in Twitch (bot data from twitchinsights.net)
  4. // @license MIT
  5. // @author İsmail Karslı <cszn@pm.me> (https://ismail.karsli.net)
  6. // @namespace https://github.com/ismailkarsli
  7. // @homepageURL https://github.com/ismailkarsli/userscripts
  8. // @supportURL https://github.com/ismailkarsli/userscripts/issues
  9. // @version 1.0.0
  10. // @match https://www.twitch.tv/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. const bots = new Set();
  15. const MutationObserver =
  16. window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  17. const observer = new MutationObserver((e) => {
  18. let chatters = document.querySelectorAll(".chatter-list-item");
  19. chatters.forEach((chatter) => {
  20. const username = chatter.querySelector("button.tw-link")?.innerText;
  21. const isBot = bots.has(username);
  22. if (isBot) {
  23. chatter.style.display = "none";
  24. }
  25. });
  26. });
  27.  
  28. fetch("https://api.twitchinsights.net/v1/bots/online")
  29. .then((res) => res.json())
  30. .then((data) => {
  31. data?.bots?.forEach((bot) => bot?.[0] && bots.add(bot[0]));
  32. if (bots.size) {
  33. observer.observe(document.body, {
  34. childList: true,
  35. subtree: true,
  36. });
  37. }
  38. })
  39. .catch((error) => console.warn("Twitch Hide Viewer Bots", "Bot list couldn't fetched", error));

QingJ © 2025

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