Aria2 Downloader from Seedbox

Download from seedbox using aria2

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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]);
    }
}