igg-games/bluemediafiles auto continue after wait

skips the waiting time on igg-games/bluemediafiles and continues to the download page

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         igg-games/bluemediafiles auto continue after wait
// @namespace    https://github.com/Alistair1231/my-userscripts/
// @version      0.7.1
// @description  skips the waiting time on igg-games/bluemediafiles and continues to the download page
// @author       Alistair1231
// @match        http*://*/*
// @license      MIT
// ==/UserScript==
// https://greasyfork.org/en/scripts/425739-igg-games-bluemediafiles-auto-continue-after-wait
// https://openuserjs.org/scripts/Alistair1231/igg-gamesbluemediafiles_auto_continue_after_wait/
// https://github.com/Alistair1231/my-userscripts/raw/master/iggAutoContinue.user.js

(function () {
  "use strict";
  if (window.location.href.match(/.*bluemedia.*url-generator-?\d+?.php/)) {
    const getCode = () => {
      var scripts = document.getElementsByTagName("script");

      // Regex to match the function call
      var regex = /Goroi_n_Create_Button\("([^"]+)"\)/;

      // Loop through all script tags
      for (var i = 0; i < scripts.length; i++) {
        var scriptContent = scripts[i].textContent;

        // Check if the script contains the function call
        var matches = regex.exec(scriptContent);
        if (matches) {
          // Found the argument, do something with it
          console.log("Extracted d_roi:", matches[1]);
          return matches[1];
          break;
        }
      }
      return -1;
    };

    const decodeCode = (d_roi) => {
      var KQ_URL_DOWNLOAD_LINK_DA_ENCRYPT_Lan_2 = "";
      for (i = d_roi.length / 0x2 - 0x5; i >= 0x0; i = i - 0x2) {
        KQ_URL_DOWNLOAD_LINK_DA_ENCRYPT_Lan_2 += d_roi[i];
      }
      for (i = d_roi.length / 0x2 + 0x4; i < d_roi.length; i = i + 0x2) {
        KQ_URL_DOWNLOAD_LINK_DA_ENCRYPT_Lan_2 += d_roi[i];
      }
      return KQ_URL_DOWNLOAD_LINK_DA_ENCRYPT_Lan_2;
    };

    var decodedCode = decodeCode(getCode());
    console.log(`decoded: ${decodedCode}`);
    window.location = "/get-url.php?url=" + decodedCode;
    
    
    //   old logic
    // // waiting for countown
    // var clickButton;
    // var count = 0;
    // var interval = setInterval(() => {
    //     clickButton = document.getElementById("nut");
    //     count++;
    //     console.log("Waited " + count + " seconds");
    //     if (clickButton.src !== "") {
    //         //clicking
    //         clickButton.parentElement.submit();
    //         clearInterval(interval);
    //     }
    // }, 1000);
  }
})();