Pixeldrain No Limit DL on F95Zone.to

Integrates a raw Cybar URL into F95Zone threads

Versione datata 18/07/2025. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Pixeldrain No Limit DL on F95Zone.to
// @namespace    https://greasyfork.org/fr/users/1468290-payamarre
// @version      1.1
// @icon         https://www.google.com/s2/favicons?sz=64&domain=f95zone.to
// @description  Integrates a raw Cybar URL into F95Zone threads
// @author       NoOne
// @license MIT
// @match        https://f95zone.to/*
// @grant        GM_xmlhttpRequest
// @connect      f95zone.to
// ==/UserScript==

/* >> This script works better when used alongside:
 * >> F95Zone-Skipper → https://github.com/Cat-Ling/f95zone-skipper
 * >> Pixeldrain-Bypass-Userscript → https://github.com/MegaLime0/pixeldrain-bypass-usercript
 * >> No links showing? Click the Pixeldrain link, complete the CAPTCHA, then refresh the page.
 */

(function () {
    'use strict';

    const CYBAR_BASE = "https://pd.cybar.xyz/";

    if (window.location.hostname === 'f95zone.to' && !window.location.pathname.startsWith('/masked/')) {
        const addCybarLinks = () => {
            const links = document.querySelectorAll('a[href*="/masked/pixeldrain.com/"]');

            links.forEach(link => {
                if (link.dataset.cybarDone) return;
                link.dataset.cybarDone = "true";

                GM_xmlhttpRequest({
                    method: "POST",
                    url: link.href,
                    headers: {
                        "Content-Type": "application/x-www-form-urlencoded"
                    },
                    data: "xhr=1&download=1",
                    onload: function (res) {
                        try {
                            const json = JSON.parse(res.responseText);
                            if (json.status === "ok" && json.msg.includes("pixeldrain.com/u/")) {
                                const match = json.msg.match(/pixeldrain\.com\/u\/([\w\d]+)/);
                                if (match && match[1]) {
                                    const cybarUrl = CYBAR_BASE + match[1];

                                    const rawLink = document.createElement('a');
                                    rawLink.href = cybarUrl;
                                    rawLink.textContent = ` [${match[1]}]`;
                                    rawLink.style.color = "#a4be8c";
                                    rawLink.style.marginLeft = "5px";
                                    rawLink.target = "_blank";

                                    link.insertAdjacentElement('afterend', rawLink);
                                }
                            }
                        } catch (e) {
                            console.error("Erreur parsing JSON pour :", link.href, e);
                        }
                    },
                    onerror: function () {
                        console.error("Erreur HTTP pour :", link.href);
                    }
                });
            });
        };

        addCybarLinks();
        const observer = new MutationObserver(addCybarLinks);
        observer.observe(document.body, { childList: true, subtree: true });
    }
})();