Auto Retry for lucida.to

Automatically press the retry button when something goes wrong. Mostly meant to fix error 429 but also works for other errors.

Verzia zo dňa 28.10.2024. Pozri najnovšiu verziu.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, Greasemonkey alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey alebo Userscripts.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie správcu používateľských skriptov.

(Už mám správcu používateľských skriptov, nechajte ma ho nainštalovať!)

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

(Už mám správcu používateľských štýlov, nechajte ma ho nainštalovať!)

// ==UserScript==
// @name         Auto Retry for lucida.to
// @author       cracktorio
// @namespace    https://cracktorio.net/
// @version      1.0
// @description  Automatically press the retry button when something goes wrong. Mostly meant to fix error 429 but also works for other errors.
// @match        *://lucida.to/*
// @grant        none
// @license      GNU GPLv3
// ==/UserScript==

(function() {
    'use strict';

    // Define the selector for the div that changes display
    const displayDivSelector = '#zip-error'; // Replace with the actual class of the div
    let displayDiv;
    let RetryButton;
    console.log("retry download script running");

    // Interval check function to detect display change
    setInterval(() => {
    displayDiv = document.querySelector(displayDivSelector);
    RetryButton = document.querySelector('button[data-action="retry"]');

        if (displayDiv && window.getComputedStyle(displayDiv).display !== 'none' && RetryButton) {
            console.log("Waiting 200ms to press retry button.");
            setTimeout(() => {
                RetryButton.click();
                console.log("Retry button clicked due to display change.");
            }, 200); // Wait 200ms before clicking
        }
    }, 2000); // Check every 2000 milliseconds

})();