F95Zone.to - Pixeldrain/Gofile No Limit DL

Want unlimited Download on Pixeldrain? This script integrates a raw pd.cybar.xyz URL into F95Zone threads

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         F95Zone.to - Pixeldrain/Gofile No Limit DL
// @namespace    https://greasyfork.org/fr/users/1468290-payamarre
// @version      1.5
// @icon         https://www.google.com/s2/favicons?sz=64&domain=f95zone.to
// @description  Want unlimited Download on Pixeldrain? This script integrates a raw pd.cybar.xyz URL into F95Zone threads
// @author       NoOne
// @license MIT
// @match        https://f95zone.to/*
// @grant        GM_xmlhttpRequest
// @connect      f95zone.to
// ==/UserScript==

(function(){
    const CYGF="https://gf.1drv.eu.org/";
    const CYPX="https://pd.1drv.eu.org/";

    const style=document.createElement("style");
    style.textContent=".dlx{cursor:pointer;background:none;border:none;font-size:18px;margin-left:6px;text-decoration:none;color:inherit}";
    document.head.appendChild(style);

    function attachButton(a){
        if(a.nextSibling && a.nextSibling.classList && a.nextSibling.classList.contains("dlx")) return;

        const b=document.createElement("button");
        b.className="dlx";
        b.textContent="🔃";

        b.onclick=()=>processLink(a,b);

        a.insertAdjacentElement("afterend",b);
    }

    function processLink(a,b){
        b.textContent="⏳";
        GM_xmlhttpRequest({
            method:"POST",
            url:a.href,
            headers:{"Content-Type":"application/x-www-form-urlencoded"},
            data:"xhr=1&download=1",
            onload:r=>{
                let json;
                try{ json=JSON.parse(r.responseText); }
                catch(e){ b.textContent="❌"; openCaptcha(a.href); return; }
                if(!json.msg){ b.textContent="❌"; openCaptcha(a.href); return; }

                let html=json.msg;
                let g=html.match(/gofile\.io\/d\/([\w\d]+)/);
                let p=html.match(/pixeldrain\.com\/u\/([\w\d]+)/);

                let linkUrl=null;
                if(g) linkUrl=CYGF+g[1];
                else if(p) linkUrl=CYPX+p[1];

                if(linkUrl){
                    const aLink=document.createElement("a");
                    aLink.href=linkUrl;
                    aLink.textContent="⬇️";
                    aLink.target="_blank";
                    aLink.className="dlx";
                    b.replaceWith(aLink);
                    return;
                }

                if(/captcha|recaptcha/i.test(html)){ b.textContent="❌"; openCaptcha(a.href); return; }
                b.textContent="💀";
            },
            onerror:()=>b.textContent="💀"
        });
    }

    function openCaptcha(url){
        window.open(url,"captcha","width=600,height=800");
    }

    function scanLinks(){
        document.querySelectorAll('a[href*="/masked/gofile.io/"],a[href*="/masked/pixeldrain.com/"]').forEach(attachButton);
    }

    scanLinks();
    new MutationObserver(scanLinks).observe(document.body,{childList:true,subtree:true});
})();