DropGalaxy Auto Skip

Auto skip ads and auto download on DropGalaxy

当前为 2024-04-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name DropGalaxy Auto Skip
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3.1
  5. // @description Auto skip ads and auto download on DropGalaxy
  6. // @author kleptomaniac14
  7. // @match https://dropgalaxy.com/*
  8. // @match https://dropgalaxy.co/*
  9. // @match https://financemonk.net/*
  10. // @icon https://www.google.com/s2/favicons?domain=dropgalaxy.com
  11. // @grant none
  12. // @license GNU GPLv2
  13. // ==/UserScript==
  14.  
  15. // Setting esversion to 11 to use optional chaining.
  16. /* jshint esversion: 11 */
  17.  
  18. (function () {
  19. "use strict";
  20.  
  21. // Constants
  22. const MAX_IDENTIFICATION_RETRIES = 100;
  23.  
  24. // Global Variables
  25. let identificationRetries = 0;
  26.  
  27. // Utils
  28. const log = (message) => console.log(`[DropGalaxy Auto Skip] ${message}`);
  29.  
  30. // One Time Setup
  31. log("DropGalaxy Script Loaded");
  32.  
  33. // Page Handlers
  34. const handlePage1 = () => {
  35. log("Handling Page 1");
  36.  
  37. // Click on Download Button
  38. const downloadBtn = document.getElementById("method_free");
  39. downloadBtn.click();
  40. };
  41.  
  42. const handlePage3 = () => {
  43. log("Handling Page 3");
  44.  
  45. // Click on Download Button
  46. const downloadForm = document.getElementById("dllink");
  47. const url = downloadForm.action;
  48.  
  49. window.location.assign(url);
  50. };
  51.  
  52. const handlePage2 = () => {
  53. log("Handling Page 2");
  54.  
  55. const falseDownloadBtn = document.getElementById("downloadbtn");
  56. const tokenStatus = document.getElementById("tokennstatus");
  57.  
  58. // Keep clicking until enabled
  59. const downloadIntervalId = setInterval(() => {
  60. if (
  61. tokenStatus.innerText === "ready!" &&
  62. falseDownloadBtn.disabled === false
  63. ) {
  64. log("Download Button Enabled, submitting form");
  65. // downloadBtn.click();
  66. document.getElementById("ff1").submit();
  67. clearInterval(downloadIntervalId);
  68. }
  69. }, 500);
  70. };
  71.  
  72. const handlePage = (pageWatcherIntervalId) => {
  73. const page1Identifier = document.getElementById("method_free");
  74. const page2Identifier = document.getElementById("countdown");
  75. const page3Identifier = document.getElementById("url");
  76.  
  77. const adblockPageIdentifier = document.querySelector(
  78. "body > div.container.pt-5.page.message > div > div > div"
  79. );
  80. const isAdblockPage =
  81. adblockPageIdentifier?.innerText === "\nAdblock Detected!";
  82.  
  83. // If page is recognized, clear the interval to stop checking
  84. if (
  85. pageWatcherIntervalId &&
  86. (page1Identifier ||
  87. page2Identifier ||
  88. page3Identifier ||
  89. isAdblockPage)
  90. ) {
  91. log("Page Identified, stopping page watcher");
  92. clearInterval(pageWatcherIntervalId);
  93. // identificationRetries = 0;
  94. // no need to reset retries, as it will be reset on next page load
  95. }
  96.  
  97. if (page1Identifier) {
  98. handlePage1();
  99. } else if (page2Identifier) {
  100. handlePage2();
  101. } else if (page3Identifier) {
  102. handlePage3();
  103. } else if (isAdblockPage) {
  104. // handleAdblockPage();
  105. // Not implemented
  106. } else if (MAX_IDENTIFICATION_RETRIES > identificationRetries) {
  107. log("Unknown Page or Waiting for identification");
  108. identificationRetries++;
  109. }
  110. };
  111.  
  112. // Keep checking the page as soon as it loads
  113. let intervalId = setInterval(() => {
  114. handlePage(intervalId);
  115. }, 500);
  116. })();