F95Zone.to - Pixeldrain/Gofile No Limit DL

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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