TVBOXNOW

enter something useful

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name TVBOXNOW
// @namespace http://your.homepage/
// @version 0.3
// @description enter something useful
// @author You
// @match http://www.tvboxnow.com/thread-*.html
// @match http://www.tvboxnow.com/viewthread.php?*
// @match http://tv520.funbbs.me/thread-*.html
// @grant none
// ==/UserScript==

(function() {
    document.body.insertAdjacentHTML('beforeend', '<div style="position:fixed;right:10px;bottom:10px;padding:10px;border:1px solid black;background:white;z-index:999999;"><button id="btnDownloadAll">Download all</button></div>');
    document.getElementById('btnDownloadAll').onclick = function() {
        var links = document.querySelectorAll('a[href^="attachment.php?"]');
        for (var i = 0; i < links.length; i++) {
            var link = links[i];
            if (link.innerHTML.indexOf('.torrent') !== -1) {
                document.body.insertAdjacentHTML('beforeend', '<iframe id="pnlDownload" style="display:none;" src="'+link.href+'" onload="this.parent.removeChild(this);"></iframe>');
                console.log(link.href);
            }
        }
    };
})();