Datanodes Auto Downloader

Datanodes Auto Downloader by Games4u

  1. // ==UserScript==
  2. // @name Datanodes Auto Downloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.0
  5. // @description Datanodes Auto Downloader by Games4u
  6. // @author Games4u.Org
  7. // @match https://datanodes.to/*
  8. // @icon https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://datanodes.to&size=64
  9. // @grant GM_download
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Function to initiate the download and close the tab
  17. function initiateDownloadAndCloseTab() {
  18. // Find the first submit button and click it immediately
  19. var firstButton = document.querySelector('button[type="submit"]');
  20. if (firstButton) {
  21. firstButton.click();
  22. console.log("First button clicked immediately");
  23.  
  24. // Wait briefly to ensure DOM updates (adjust if necessary)
  25. setTimeout(function() {
  26. var form = document.createElement('form');
  27. form.name = "F1";
  28. form.method = "POST";
  29. form.className = "m-0";
  30. form.action = "";
  31.  
  32. // Extract the file ID dynamically from the hidden input
  33. var fileIdInput = document.querySelector('input[name="id"]');
  34. var fileId = fileIdInput ? fileIdInput.value : "";
  35.  
  36. // Extract the file name dynamically from the hidden input
  37. var fileNameInput = document.querySelector('input[name="fname"]');
  38. var fileName = fileNameInput ? fileNameInput.value : "";
  39.  
  40. form.innerHTML = `
  41. <input type="hidden" name="op" value="download2">
  42. <input type="hidden" name="id" value="${fileId}">
  43. <input type="hidden" name="rand">
  44. <input type="hidden" name="referer" value="">
  45. <input type="hidden" name="method_free" value="Free Download >>">
  46. <input type="hidden" name="method_premium">
  47. <div class="flex gap-3" style="display: none;">
  48. <button type="button" class="px-3 py-2.5 font-semibold bg-blue-500 rounded-lg text-white text-xs hover:text-white hover:bg-blue-800">
  49. <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" class="w-5 h-5">
  50. <path stroke-linecap="round" stroke-linejoin="round" d="M17.25 8.25L21 12m0 0l-3.75 3.75M21 12H3"></path>
  51. </svg>
  52. </button>
  53. </div>
  54. <button type="submit" class="py-3 relative shadow px-6 hover:opacity-90 rounded-lg bg-white text-sm font-medium text-blue-600 w-full flex items-center justify-between">
  55. Continue
  56. <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
  57. <path stroke-linecap="round" stroke-linejoin="round" d="M7.5 7.5h-.75A2.25 2.25 0 004.5 9.75v7.5a2.25 2.25 0 002.25 2.25h7.5a2.25 2.25 0 002.25-2.25v-7.5a2.25 2.25 0 00-2.25-2.25h-.75m-6 3.75l3 3m0 0l3-3m-3 3V1.5m6 9h.75a2.25 2.25 0 012.25 2.25v7.5a2.25 2.25 0 01-2.25 2.25h-7.5a2.25 2.25 0 01-2.25-2.25v-.75"></path>
  58. </svg>
  59. </button>
  60. `;
  61.  
  62. // Replace existing button with new form
  63. var firstButtonParent = firstButton.parentElement;
  64. firstButtonParent.replaceWith(form);
  65.  
  66. // Submit the form after a brief delay to ensure DOM updates
  67. setTimeout(function() {
  68. form.submit();
  69. console.log("Form submitted immediately");
  70.  
  71. // Close the tab after a short delay (adjust as needed)
  72. setTimeout(function() {
  73. window.close();
  74. console.log("Tab closed");
  75. }, 2000); // Close tab after 2 seconds (adjust as needed)
  76. }, 500); // Submit form after 0.5 seconds (adjust as needed)
  77. }, 200); // Replace button with form after 0.2 seconds (adjust as needed)
  78. } else {
  79. console.log("First button not found, proceeding to the next step...");
  80. // Implement logic to proceed to the next step if needed
  81. }
  82. }
  83.  
  84. // Execute the function
  85. initiateDownloadAndCloseTab();
  86. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址