DropGalaxy Auto Skip

Auto skip ads and auto download on DropGalaxy

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

  1. // ==UserScript==
  2. // @name DropGalaxy Auto Skip
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.4
  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. // Setting esversion to 11 to use optional chaining.
  15. /* jshint esversion: 11 */
  16. (function () {
  17. "use strict";
  18. // Constants
  19. const MAX_IDENTIFICATION_RETRIES = 100;
  20. // Global Variables
  21. let identificationRetries = 0;
  22. // Utils
  23. const log = (message) => console.log(`[DropGalaxy Auto Skip] ${message}`);
  24. // One Time Setup
  25. log("DropGalaxy Script Loaded");
  26. // Page Handlers
  27. const handlePage1 = () => {
  28. log("Handling Page 1");
  29. // Click on Download Button
  30. const downloadBtn = document.getElementById("method_free");
  31. downloadBtn.click();
  32. };
  33. const handlePage3 = () => {
  34. log("Handling Page 3");
  35. // Click on Download Button
  36. const downloadForm = document.getElementById("dllink");
  37. const url = downloadForm.action;
  38. window.location.assign(url);
  39. };
  40. const handlePage2 = () => {
  41. log("Handling Page 2");
  42. const falseDownloadBtn = document.getElementById("downloadbtn");
  43. const tokenStatus = document.getElementById("tokennstatus");
  44. // Keep clicking until enabled
  45. const downloadIntervalId = setInterval(() => {
  46. if (tokenStatus.innerText === "click on- verify you are human...") {
  47. // In case CAPTCHA appears
  48. document.querySelector(".mark").click();
  49. } else if (
  50. // If download button is enabled and CAPTCHA is solved, submit the form
  51. tokenStatus.innerText === "ready! click on create download link" &&
  52. falseDownloadBtn.disabled === false
  53. ) {
  54. log("Download Button Enabled, submitting form");
  55. // downloadBtn.click();
  56. document.getElementById("ff1").submit();
  57. clearInterval(downloadIntervalId);
  58. }
  59. }, 500);
  60. };
  61. const handlePage = (pageWatcherIntervalId) => {
  62. const page1Identifier = document.getElementById("method_free");
  63. const page2Identifier = document.getElementById("countdown");
  64. const page3Identifier = document.getElementById("dllink");
  65. const adblockPageIdentifier = document.querySelector(
  66. "body > div.container.pt-5.page.message > div > div > div"
  67. );
  68. const isAdblockPage =
  69. adblockPageIdentifier?.innerText === "\nAdblock Detected!";
  70. // If page is recognized, clear the interval to stop checking
  71. if (
  72. pageWatcherIntervalId &&
  73. (page1Identifier ||
  74. page2Identifier ||
  75. page3Identifier ||
  76. isAdblockPage)
  77. ) {
  78. log("Page Identified, stopping page watcher");
  79. clearInterval(pageWatcherIntervalId);
  80. // identificationRetries = 0;
  81. // no need to reset retries, as it will be reset on next page load
  82. }
  83. if (page1Identifier) {
  84. handlePage1();
  85. } else if (page2Identifier) {
  86. handlePage2();
  87. } else if (page3Identifier) {
  88. handlePage3();
  89. } else if (isAdblockPage) {
  90. // handleAdblockPage();
  91. // Not implemented
  92. } else if (MAX_IDENTIFICATION_RETRIES > identificationRetries) {
  93. log("Unknown Page or Waiting for identification");
  94. identificationRetries++;
  95. } else {
  96. log("Max Identification Retries Reached, Stopping Page Watcher");
  97. clearInterval(pageWatcherIntervalId);
  98. }
  99. };
  100. // Keep checking the page as soon as it loads
  101. let intervalId = setInterval(() => {
  102. handlePage(intervalId);
  103. }, 500);
  104. })();