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.

  1. // ==UserScript==
  2. // @name Auto Retry for lucida.to
  3. // @author cracktorio
  4. // @namespace https://cracktorio.net/
  5. // @version 1.1
  6. // @description Automatically press the retry button when something goes wrong. Mostly meant to fix error 429 but also works for other errors.
  7. // @match *://lucida.to/*
  8. // @match *://lucida.su/*
  9. // @grant none
  10. // @license GNU GPLv3
  11. // ==/UserScript==
  12. (function() {
  13. 'use strict';
  14. // Define the selector for the div that changes display
  15. const displayDivSelector = '#zip-error'; // Replace with the actual class of the div
  16. let displayDiv;
  17. let RetryButton;
  18. console.log("retry download script running");
  19. // Interval check function to detect display change
  20. setInterval(() => {
  21. displayDiv = document.querySelector(displayDivSelector);
  22. RetryButton = document.querySelector('button[data-action="retry"]');
  23. if (displayDiv && window.getComputedStyle(displayDiv).display !== 'none' && RetryButton) {
  24. console.log("Waiting 200ms to press retry button.");
  25. setTimeout(() => {
  26. RetryButton.click();
  27. console.log("Retry button clicked due to display change.");
  28. }, 200); // Wait 200ms before clicking
  29. }
  30. }, 2000); // Check every 2000 milliseconds
  31. })();