Automatic Libreddit Quota Redirector

Automatically redirects to another Libreddit instance if the one you're directed to has reached its rate limit/quota.

当前为 2023-08-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Automatic Libreddit Quota Redirector
  3. // @namespace happyviking
  4. // @version 1.19.0
  5. // @grant none
  6. // @run-at document-end
  7. // @license MIT
  8. // @description Automatically redirects to another Libreddit instance if the one you're directed to has reached its rate limit/quota.
  9. // @icon https://gitlab.com/uploads/-/system/project/avatar/32545239/libreddit.png
  10. // @author HappyViking
  11.  
  12. // <<INSTANCES START HERE>>
  13. // @match https://l.opnxng.com/*
  14. // @match https://libreddit.bus-hit.me/*
  15. // @match https://libreddit.cachyos.org/*
  16. // @match https://libreddit.domain.glass/*
  17. // @match https://libreddit.freedit.eu/*
  18. // @match https://libreddit.hu/*
  19. // @match https://libreddit.kavin.rocks/*
  20. // @match https://libreddit.kutay.dev/*
  21. // @match https://libreddit.kylrth.com/*
  22. // @match https://libreddit.mha.fi/*
  23. // @match https://libreddit.northboot.xyz/*
  24. // @match https://libreddit.oxymagnesium.com/*
  25. // @match https://libreddit.privacy.com.de/*
  26. // @match https://libreddit.pussthecat.org/*
  27. // @match https://libreddit.strongthany.cc/*
  28. // @match https://libreddit.tiekoetter.com/*
  29. // @match https://lr.4201337.xyz/*
  30. // @match https://lr.aeong.one/*
  31. // @match https://lr.artemislena.eu/*
  32. // @match https://lr.riverside.rocks/*
  33. // @match https://lr.slipfox.xyz/*
  34. // @match https://r.darklab.sh/*
  35. // @match https://r.walkx.fyi/*
  36. // @match https://rd.funami.tech/*
  37. // @match https://reddit.baby/*
  38. // @match https://reddit.dr460nf1r3.org/*
  39. // @match https://reddit.leptons.xyz/*
  40. // @match https://reddit.rtrace.io/*
  41. // @match https://reddit.simo.sh/*
  42. // @match https://reddit.smnz.de/*
  43. // @match https://reddit.utsav2.dev/*
  44. // @match https://safereddit.com/*
  45. // @match https://snoo.habedieeh.re/*
  46. // <<INSTANCES END HERE>>
  47.  
  48. // ==/UserScript==
  49.  
  50. function main() {
  51. const errorMessage = document.getElementById("error")
  52. if (!errorMessage) return;
  53. if(!errorMessage.querySelector("h1")?.innerHTML.includes("Too Many Requests")) return;
  54. const addedMessage = document.createElement("p")
  55. addedMessage.textContent = "Redirecting you to new instance..."
  56. errorMessage.appendChild(addedMessage)
  57. location.replace('https://farside.link/libreddit/' + window.location.pathname);
  58. }
  59.  
  60. main()
  61.