Socialmediagirls pixeldrain use url bypass limit

it

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

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