Sleazy Fork is available in English.

Socialmediagirls pixeldrain use url bypass limit

it

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name                Socialmediagirls pixeldrain use url bypass limit
// @namespace           https://greasyfork.org/users/821661
// @match               https://forums.socialmediagirls.com/*
// @grant               GM.xmlHttpRequest
// @version             1.0
// @run-at              document-start
// @author              hdyzen
// @description         it
// @license             GPL-3.0-only
// ==/UserScript==

function bypassUrl(id) {
    return `https://pd.cybar.xyz/${id}`;
}

async function getIndividualIds(url) {
    const res = await GM.xmlHttpRequest({
        url: url,
    });

    return [...res.response.matchAll(/"id":"([^"]+)","name"/g)].map(e => e[1]);
}

async function processNode(node) {
    const url = node.dataset.url;
    const parts = url.split("/");
    const type = parts.at(-2);
    const id = parts.at(-1);

    if (type === "l") {
        const ids = await getIndividualIds(url);

        node.innerHTML = ids.map(e => `<a href="${bypassUrl(e)}">${bypassUrl(e)}</a>`).join("\n");
    } else {
        node.innerHTML = `<a href="${bypassUrl(id)}">${bypassUrl(id)}</a>`;
    }
}

function initObserver() {
    const handleMutations = async mutations => {
        for (const mutation of mutations) {
            for (const node of mutation.addedNodes) {
                if (node.nodeType === Node.ELEMENT_NODE && node.dataset.host === "pixeldrain.com") {
                    processNode(node);
                }
            }
        }
    };

    const observer = new MutationObserver(handleMutations);

    observer.observe(document.body || document.documentElement, {
        childList: true,
        subtree: true,
    });

    disObserver(observer);
}
initObserver();

function disObserver(observer) {
    document.addEventListener("DOMContentLoaded", e => {
        observer.disconnect();
    });
}