Automatic Libreddit Quota Redirector

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

目前為 2023-09-17 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Automatic Libreddit Quota Redirector
  3. // @namespace happyviking
  4. // @version 1.41.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.freedit.eu/*
  16. // @match https://libreddit.hu/*
  17. // @match https://libreddit.kylrth.com/*
  18. // @match https://libreddit.lunar.icu/*
  19. // @match https://libreddit.mha.fi/*
  20. // @match https://libreddit.northboot.xyz/*
  21. // @match https://libreddit.oxymagnesium.com/*
  22. // @match https://libreddit.privacydev.net/*
  23. // @match https://libreddit.pussthecat.org/*
  24. // @match https://libreddit.spike.codes/*
  25. // @match https://libreddit.strongthany.cc/*
  26. // @match https://libreddit.tiekoetter.com/*
  27. // @match https://lr.4201337.xyz/*
  28. // @match https://lr.aeong.one/*
  29. // @match https://lr.artemislena.eu/*
  30. // @match https://lr.slipfox.xyz/*
  31. // @match https://r.walkx.fyi/*
  32. // @match https://reddit.invak.id/*
  33. // @match https://reddit.rtrace.io/*
  34. // @match https://reddit.simo.sh/*
  35. // @match https://reddit.smnz.de/*
  36. // @match https://reddit.utsav2.dev/*
  37. // @match https://safereddit.com/*
  38. // @match https://snoo.habedieeh.re/*
  39. // @match https://libreddit.kutay.dev/*
  40. // @match https://libreddit.projectsegfau.lt/*
  41. // @match https://libreddit.tux.pizza/*
  42. // @match https://lr.vern.cc/*
  43. // @match https://r.darklab.sh/*
  44. // @match https://reddit.leptons.xyz/*
  45. // @match https://discuss.whatever.social/*
  46. // @match https://libreddit.kavin.rocks/*
  47. // @match https://libreddit.cachyos.org/*
  48. // @match https://libreddit.domain.glass/*
  49. // @match https://libreddit.privacy.com.de/*
  50. // @match https://reddit.baby/*
  51. // <<INSTANCES END HERE>>
  52.  
  53. // ==/UserScript==
  54.  
  55. function main() {
  56. const errorMessage = document.getElementById("error")
  57. if (!errorMessage) return;
  58. if(!errorMessage.querySelector("h1")?.innerHTML.includes("Too Many Requests")) return;
  59. const addedMessage = document.createElement("p")
  60. addedMessage.textContent = "Redirecting you to new instance..."
  61. errorMessage.appendChild(addedMessage)
  62. location.replace('https://farside.link/libreddit/' + window.location.pathname + window.location.search);
  63. }
  64.  
  65. main()
  66.