Coder Social home page Coder Social logo

node-rtorrent's Introduction

node-rtorrent

control rtorrent with your nodejs project !

alt tag

Install rtorrent

check in config file (/home/user/.rtorrent.rc) that this line exist :

scgi_port = 127.0.0.1:5000

now rtorrent is available (only from localhost) with scgi on :

127.0.0.1:5000/

set xmlrpc connexion mode

open apache config file and add :

SCGIMount /RPC2 127.0.0.1:5000
<Location "/RPC2">
    AuthType Basic
    AuthName "Rtorrent"
    AuthUserFile /home/www-data/.rtorrent-htpasswd
    Require valid-user
</Location>

create a password file

htpasswd -cb /home/www-data/.rtorrent-htpasswd user password

restart apache

apachectl restart

now rtorrent is available with xmlrpc on

user:password@server:80/RPC2

Install

npm install node-rtorrent

Example

var Rtorrent = require ('node-rtorrent');

var rtorrent = new Rtorrent({
    mode: 'xmlrpc',
    host: 'yourserver',
    port: 80,
    path: '/RPC2'
    user: 'bob'
    pass: 'marley'
});

rtorrent.getAll(function (err, data) {
    if (err) return console.log('err: ', err);

    console.log(data);
    // data is : {torrents: [{hash: 'XXXXXX', name: 'ubuntu.iso', path: '/xxx', bitfield: ......... }, {...}], up_total: ...}
});

rtorrent.start('XXXXXXXX', function (err, data) {
    if (err) return console.log('err: ', err);

    console.log(data);
});

rtorrent.loadLink(...

rtorrent.loadFile(...

and more : Click here !

use from command line

USAGE: node-rtorrent cmd ...

Exemples:
    node-rtorrent get download_list
    node-rtorrent get d.multicall main d.name= d.get_base_path
    node-rtorrent get t.multicall XXXXXXX t.id= t.url=
    node-rtorrent get load "magnet:?xt=urn:xxxx"
    node-rtorrent get load "http://xxx/xxx.torrent"
    node-rtorrent getAll

node-rtorrent's People

Contributors

rafipiccolo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.