Aria2 Downloader from Seedbox

Download from seedbox using aria2

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

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

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         Aria2 Downloader from Seedbox
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Download from seedbox using aria2
// @author       Kevincj
// @match        *://*.feralhosting.com/*
// @icon         https://www.google.com/s2/favicons?domain=google.com
// @grant        GM_xmlhttpRequest
// @grant        GM_notification
// ==/UserScript==


function download(e) {
    var prefix = window.location.href;
    var i;
    for (i = prefix.length - 1; i >= 0; i --){
        if (prefix[i] == '/'){
            prefix = prefix.substring(0, i+1);
            break;
        }
    }
    var link = prefix+this.getAttribute('href');
    let reqParams = {
                'jsonrpc': '2.0',
                'method' : 'aria2.addUri',
                'id'     : (+new Date()).toString(),
                'params' : []
            };
    reqParams.params.push([link]);

    // Fill in your usr-pwd here if password is enabled
    let options = {
        'http-user' : '',
        'http-passwd' : ''
    };
    reqParams.params.push(options);



    GM_xmlhttpRequest({
        method : 'POST',
        url    : 'http://localhost:6800/jsonrpc',
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
        },
        data   : JSON.stringify(reqParams)
    });
   e = e || window.event;
    e.preventDefault();

}


function bindDownload(ele){
    console.log('binding');
    ele.addEventListener("click", download, false);
}



let links = document.getElementsByTagName('a');
var i;
for (i = 5; i < links.length; i ++) {
    let link = links[i].getAttribute('href');
    if (link.charAt(link. length-1) != '/'){
         bindDownload(links[i]);
    }
}