MediaFire Batch Downloader

Batch download files from a MediaFire folder

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         MediaFire Batch Downloader
// @namespace    http://tampermonkey.net/
// @include     http://www.mediafire.com/folder/*
// @include     https://www.mediafire.com/folder/*
// @include     http://www.mediafire.com/file/*
// @include     https://www.mediafire.com/file/*
// @version      0.1
// @description  Batch download files from a MediaFire folder
// @author       ShadowLin
// @license      GNU GPL v3
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function startDownload() {
        var listItems = document.querySelectorAll('#main_list > li');
        for (var i = 0; i < listItems.length; i++) {
            var link = listItems[i].querySelector('a');
            if (link) {
                window.open(link.href, '_blank');
            }
        }
    }

    var upgradeButtonFrame = document.querySelector('.upgrade_button_frame');
    if (upgradeButtonFrame) {
        var button = document.createElement('button');
        button.textContent = 'DOWNLOAD ALL';
        button.classList.add('Btn', 'Btn--greenUpgrade');
        button.style.backgroundColor = '#33CC66';
        button.style.color = '#222835';
        button.addEventListener('click', startDownload);
        upgradeButtonFrame.parentNode.replaceChild(button, upgradeButtonFrame);
    }
})();

(function() {
    'use strict';

    var input = document.querySelector('.download_link .input');
    if (input) {
        var dl = input.getAttribute('href');
        console.log(dl);
        location.replace(dl);

        var set = setInterval(closeWindows, 1000 * 5);

        function closeWindows() {
            window.close();
            clearInterval(set);
        }
    } else {
        console.error('Could not find download link');
    }
})();