Render-State Instant Resolver

use https://greasyfork.org/en/scripts/439469-adlbypasser-v1-6-ouo-io-uii-io-exe-io-bc-vc-adf-ly-more-no-ads/post-install with this.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        Render-State Instant Resolver
// @namespace   Violentmonkey Scripts
// @icon        https://render-state.to/wp-content/uploads/2020/09/cropped-favicon-290x290.png
// @version     1.0.1
//
// @match       https://render-state.to/download/*
// @grant       none
// @license     MIT
//
// @author      Schaken
// @description use https://greasyfork.org/en/scripts/439469-adlbypasser-v1-6-ouo-io-uii-io-exe-io-bc-vc-adf-ly-more-no-ads/post-install with this.
// ==/UserScript==


(function() {
    'use strict';

    const RESOLVE_PATTERN = /url-masker-pro\/v1\/resolve\//;

    // --- Intercept fetch() ---
    const origFetch = window.fetch;
    window.fetch = function(...args) {
        const url = args[0];
        if (typeof url === "string" && RESOLVE_PATTERN.test(url)) {
            console.log("Intercepted resolve fetch:", url);
            return origFetch(...args).then(async resp => {
                try {
                    const clone = resp.clone();
                    const data = await clone.json();
                    console.log("Resolve response:", data);
                    if (data && data.url) {
                        window.location.href = data.url;
                    }
                } catch (e) {
                    console.error("Fetch intercept error:", e);
                }
                return resp;
            });
        }
        return origFetch(...args);
    };

    // --- Intercept XMLHttpRequest ---
    const origOpen = XMLHttpRequest.prototype.open;
    XMLHttpRequest.prototype.open = function(method, url, ...rest) {
        this._isResolve = RESOLVE_PATTERN.test(url);
        return origOpen.call(this, method, url, ...rest);
    };

    const origSend = XMLHttpRequest.prototype.send;
    XMLHttpRequest.prototype.send = function(...args) {
        if (this._isResolve) {
            this.addEventListener("load", function() {
                try {
                    const data = JSON.parse(this.responseText);
                    console.log("XHR resolve response:", data);
                    if (data && data.url) {
                        window.location.href = data.url;
                    }
                } catch (e) {
                    console.error("XHR intercept error:", e);
                }
            });
        }
        return origSend.apply(this, args);
    };
})();