Sfoglia il codice sorgente

Adding Reload 1337x.to

Jason Tarka 1 anno fa
parent
commit
dd89b707fa
1 ha cambiato i file con 22 aggiunte e 0 eliminazioni
  1. 22 0
      JS/Reload 1337x.to.user.js

+ 22 - 0
JS/Reload 1337x.to.user.js

@@ -0,0 +1,22 @@
+// ==UserScript==
+// @name         Reload 1337x.to
+// @namespace    http://tampermonkey.net/
+// @version      2024-01-28
+// @description  Reload when getting rate limited.
+// @author       Jason
+// @match        https://1337x.to/*
+// @icon         https://www.google.com/s2/favicons?sz=64&domain=1337x.to
+// @grant        none
+// ==/UserScript==
+
+(function() {
+    'use strict';
+
+    const DELAY = 1000 + (Math.random() * 2000);
+
+    let header = document.querySelector('h1');
+    // Header is showing rate limited error.
+    if(header.innerText.includes('1015')) {
+        setTimeout(() => location.reload(), DELAY);
+    }
+})();