PearCrypt Skip

Extract all direct links on PearCrypt without the site loading all its bloated garbage.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         PearCrypt Skip
// @version      05-18-26
// @description  Extract all direct links on PearCrypt without the site loading all its bloated garbage.
// @author       maybeyou
// @match        https://pearcrypt.lol/container/*
// @grant        none
// @run-at       document-start
// @namespace https://greatest.deepsurf.us/users/1122886
// ==/UserScript==

(function() {
    'use strict';

    var s = document.createElement('style');
    s.textContent = 'body{display:none!important}';
    document.documentElement.appendChild(s);

    function ready(fn) {
        if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', fn);
        else fn();
    }

    function waitEl(sel, ms) {
        return new Promise(function(res, rej) {
            var t = Date.now();
            function check() {
                var el = document.querySelector(sel);
                if (el) return res(el);
                if (Date.now() - t > (ms||20000)) return rej();
                requestAnimationFrame(check);
            }
            check();
        });
    }

    function waitDialog(ms) {
        return new Promise(function(res, rej) {
            var obs = new MutationObserver(function() {
                var d = document.querySelector('[role="dialog"]');
                if (d && d.dataset.state === 'open') { obs.disconnect(); res(d); }
            });
            obs.observe(document.body, {childList:true, subtree:true, attributes:true, attributeFilter:['data-state']});
            setTimeout(function(){ obs.disconnect(); rej(); }, ms||8000);
        });
    }

    async function getLinks() {
        var btn = await waitEl('button:has(svg.lucide-link2)');
        btn.click();
        var dlg = await waitDialog();
        var els = dlg.querySelectorAll('div[data-radix-scroll-area-viewport] div.rounded-md');
        return Array.from(els).map(function(e){ return e.textContent.trim(); });
    }

    function show(links) {
        window.stop();
        document.documentElement.innerHTML = '';
        var pre = document.createElement('pre');
        pre.textContent = links.join('\n');
        pre.style.cssText = 'margin:20px;font-family:monospace;white-space:pre-wrap;word-break:break-all';
        document.body.appendChild(pre);
    }

    ready(function() {
        getLinks().then(function(links) {
            if (!links.length) throw new Error();
            show(links);
        }).catch(function() {
            document.documentElement.innerHTML = 'Error';
        });
    });
})();