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.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Define the selector for the div that changes display
  17. const displayDivSelector = '#zip-error'; // Replace with the actual class of the div
  18. let displayDiv;
  19. let RetryButton;
  20. console.log("retry download script running");
  21.  
  22. // Interval check function to detect display change
  23. setInterval(() => {
  24. displayDiv = document.querySelector(displayDivSelector);
  25. RetryButton = document.querySelector('button[data-action="retry"]');
  26.  
  27. if (displayDiv && window.getComputedStyle(displayDiv).display !== 'none' && RetryButton) {
  28. console.log("Waiting 200ms to press retry button.");
  29. setTimeout(() => {
  30. RetryButton.click();
  31. console.log("Retry button clicked due to display change.");
  32. }, 200); // Wait 200ms before clicking
  33. }
  34. }, 2000); // Check every 2000 milliseconds
  35.  
  36. })();