Reload 1337x.to.user.js 630 B

12345678910111213141516171819202122
  1. // ==UserScript==
  2. // @name Reload 1337x.to
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-01-28
  5. // @description Reload when getting rate limited.
  6. // @author Jason
  7. // @match https://1337x.to/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=1337x.to
  9. // @grant none
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. const DELAY = 1000 + (Math.random() * 2000);
  14. let header = document.querySelector('h1');
  15. // Header is showing rate limited error.
  16. if(header.innerText.includes('1015')) {
  17. setTimeout(() => location.reload(), DELAY);
  18. }
  19. })();