Pixeldrain Bypass

Bypass Pixeldrain download limits

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Pixeldrain Bypass
// @namespace    https://github.com/xmtaha
// @version      1.8
// @description  Bypass Pixeldrain download limits
// @author       xmtaha
// @match        https://pixeldrain.com/*
// @match        https://www.pixeldrain.com/*
// @match        https://pixeldra.in/*
// @match        https://www.pixeldra.in/*
// @match        https://pixeldrain.dev/*
// @match        https://www.pixeldrain.dev/*
// @grant        none
// @icon         https://pixeldrain.com/favicon.ico
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    function extractFileId() {
        const url = window.location.href;
        const match = url.match(/(?:pixeldrain\.com|pixeldra\.in|pixeldrain\.dev)\/u\/([a-zA-Z0-9]+)/);
        return match ? match[1] : null;
    }

    function createBypassButton() {
        const fileId = extractFileId();
        if (!fileId) return;

        const bypassUrl = `https://cdn.pixeldrain.eu.cc/${fileId}?download`;

        const existingBtn = document.getElementById('pd-unlimited-dl');
        if (existingBtn) {
            existingBtn.dataset.url = bypassUrl;
            return;
        }

        const originalBtn = document.querySelector('.description .button_highlight');
        if (!originalBtn) return;

        const bypassBtn = document.createElement('button');
        bypassBtn.id = 'pd-unlimited-dl';
        bypassBtn.className = originalBtn.className;
        bypassBtn.style.marginLeft = '10px';
        bypassBtn.innerHTML = '<i class="icon">download</i> <span>Unlimited Download</span>';
        bypassBtn.dataset.url = bypassUrl;

        bypassBtn.onclick = function () {
            const urlToOpen = this.dataset.url;
            const tempLink = document.createElement('a');
            tempLink.href = urlToOpen;
            tempLink.setAttribute('download', '');
            tempLink.target = '_blank';
            tempLink.rel = 'noreferrer noopener';
            document.body.appendChild(tempLink);
            tempLink.click();
            document.body.removeChild(tempLink);
        };

        originalBtn.parentNode.insertBefore(bypassBtn, originalBtn.nextSibling);
    }

    function init() {
        createBypassButton();

        const observer = new MutationObserver((mutations) => {
            for (const mutation of mutations) {
                if (mutation.addedNodes.length > 0) {
                    createBypassButton();
                }
            }
        });

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

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

})();