Advanced Bypass for MegaVIP and Similar Links

Bypass shortlinks on megavip.store and similar sites automatically.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==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);
})();