xBunker Post Images Downloader

xBa

Jan 22, 2020
76
26,290
3,621
leakednudes.co
Updated 09/04/2023

1. Go to your Google Chrome extension page by clicking
(For Safari/Mac users )

You must be registered for see images


2. Search for TamperMonkey

You must be registered for see images


3. Click on “Add to Chrome”

You must be registered for see images


4. Add the Extension to your chrome

You must be registered for see images


5. Once it has been installed, Click on the Extension and click on Dashboard

You must be registered for see images


6. Here you will have access to the TamperMonkey Dashboard

You must be registered for see images


7. Click On + To add the script
8. Remove the default code and paste the code below then click on File -> Save
9. Go to a thread and download all attached img.kiwi images.

JavaScript:
//==UserScript==
// @name         IMG.KIWI Forum Post Downloader
// @description  Download direct img.kiwi images URLs from each post individually
// @version      0.1
// @match        https://*.xbunker.nu/*
// @require      https://code.jquery.com/jquery-3.3.1.min.js
// @require      https://unpkg.com/[email protected]/dist/jszip.min.js
// @require      https://unpkg.com/[email protected]/dist/FileSaver.min.js
// @noframes
// @run-at       document-end
// @grant        GM.xmlHttpRequest
// @grant        GM_xmlhttpRequest
// ==/UserScript==

/* globals jQuery, JSZip, saveAs */
jQuery(function($) {
    const buttonCSS = `
        .downloadButton {
            background-color: #007BFF;
            color: white;
            padding: 10px 15px;
            text-decoration: none;
            border-radius: 5px;
            font-weight: bold;
            display: inline-block;
            margin-bottom: 10px;
            position: relative;
            overflow: hidden;
        }
        .downloadButton.downloading {
            background-image: linear-gradient(to right, #4CAF50 0%, #007BFF 100%);
        }
        .downloadButton.generating {
            background-color: #FFA500;  /* This is the orange color */
            background-image: none;     /* This resets the gradient */
        }
    `;

    $('head').append('<style>' + buttonCSS + '</style>');

    $('.message-main').each(function() {
        const $thisMessage = $(this);

        const imgKiwiLinks = $thisMessage
            .find('.bbWrapper a[href*="img.kiwi"]')
            .map(function() {
                return $(this).attr('href');
            })
            .get();

        if (imgKiwiLinks.length > 0) {
            const extractLinksButton = $('<a href="#" class="downloadButton">Download Images (' + imgKiwiLinks.length + ')</a>');
            $thisMessage.prepend(extractLinksButton);
        }
    });

    $(document).on("click", ".downloadButton", function(e) {
        e.preventDefault();
        const $thisButton = $(this);

        const imgKiwiLinks = $thisButton.closest('.message-main')
            .find('.bbWrapper a[href*="img.kiwi"]')
            .map(function() {
                return $(this).attr('href');
            })
            .get();

        const zip = new JSZip();
        let downloadsLeft = imgKiwiLinks.length;

        $thisButton.text(`Downloading (0/${imgKiwiLinks.length})`).addClass('downloading');
        downloadSequentially(imgKiwiLinks, 0, zip, downloadsLeft, $thisButton);
    });

    function downloadSequentially(links, index, zip, downloadsLeft, button) {
        if (index >= links.length) {
            button.css({
                'background-image': 'none',
                'background-color': '#FFA500'
            });
            button.text('Generating ZIP...');
            zip.generateAsync({
                type: "blob"
            }).then(function(blob) {
                button.text('Downloaded');
                button.css({
                    'background-image': 'none',
                    'background-color': 'green'
                });
                saveAs(blob, "images.zip");
            });
            return;
        }

        const link = links[index];

        GM.xmlHttpRequest({
            method: "GET",
            url: link,
            onload: function(response) {
                const tempDiv = $('<div>').html(response.responseText);
                const directImageUrl = tempDiv.find('.header-content-right a.btn-download.default').attr('href');
                const imageName = directImageUrl.split("/").pop();

                GM.xmlHttpRequest({
                    method: "GET",
                    url: directImageUrl,
                    responseType: 'arraybuffer',
                    onload: function(imgResponse) {
                        zip.file(imageName, imgResponse.response);

                        downloadsLeft--;

                        let percentageComplete = ((links.length - downloadsLeft) / links.length) * 100;
                        button.css('background-image', `linear-gradient(to right, #4CAF50 ${percentageComplete}%, #007BFF ${percentageComplete + 0.1}%)`);

                        button.text(`Downloading (${links.length - downloadsLeft}/${links.length})`);
                        downloadSequentially(links, index + 1, zip, downloadsLeft, button);
                    }
                });
            }
        });
    }
});
 
Last edited: