Advanced Bypass for MegaVIP and Similar Links

Bypass shortlinks on megavip.store and similar sites automatically.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Advanced Bypass for MegaVIP and Similar Links
// @namespace    http://example.com/
// @version      1.0
// @description  Bypass shortlinks on megavip.store and similar sites automatically.
// @author       YourName
// @match        *://megavip.store/s?*
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @run-at       document-start
// ==/UserScript==

(function() {
    'use strict';

    // Utility function to wait for an element to appear on the page
    function waitForElement(selector, callback) {
        const observer = new MutationObserver(function(mutations, observer) {
            const element = document.querySelector(selector);
            if (element) {
                callback(element);
                observer.disconnect();
            }
        });
        observer.observe(document.body, { childList: true, subtree: true });
    }

    // Function to bypass shortlinks
    function bypassMegaVIP() {
        const currentUrl = window.location.href;

        // If we're on the shortlink page, start the bypass process
        if (currentUrl.includes('megavip.store/s?')) {

            // Attempt to detect captcha presence
            if (document.querySelector('.g-recaptcha') || document.querySelector('#captcha')) {
                alert("Captcha detected. Please solve the captcha manually.");
                return;
            }

            // Make a background request to the same URL to retrieve page content
            GM_xmlhttpRequest({
                method: "GET",
                url: currentUrl,
                onload: function(response) {
                    // Extract the final redirect URL from the page content using a regex search
                    const match = response.responseText.match(/window\.location\.href\s*=\s*"(https?:\/\/[^"]+)"/);

                    // If a valid URL is found, automatically redirect to it
                    if (match && match[1]) {
                        window.location.href = match[1]; // Redirect to the real link
                    } else {
                        // Fallback for dynamic button clicks
                        console.log("Redirect URL not found in HTML. Waiting for possible dynamic content...");

                        // Wait for any download button or link
                        waitForElement('a[href*="download"], .download-button', function(element) {
                            element.click();
                        });
                    }
                }
            });
        }
    }

    // Inject custom styles to hide any annoying ads or popups that may interfere with bypass
    GM_addStyle(`
        .ads, .popup, .ad-banner, .overlay, .captcha-popup {
            display: none !important;
        }
    `);

    // Start the bypass process after the page loads
    window.addEventListener('load', bypassMegaVIP);
})();