library-utorrent
Communicate with uTorrent Web API to list and add torrents, wraps the uTorrent Web API: http://help.utorrent.com/customer/portal/topics/664593/articles
Installation
$ npm install library-utorrent --save
Usage
Load the library:
var UTorrent = require ( ' library-utorrent ' ) ;
Add a Torrent file:
UTorrent . addTorrent ( {
host : ' localhost ' ,
port : 26085 ,
username : ' admin ' ,
password : ' 12345 ' ,
torrentContents : fileBufferWithTorrentContent ,
downloadDir : 0 ,
path : ' /dir/path/ ' ,
} ) . exec ( {
error : function ( err ) {
} ,
success : function ( ) {
}
} ) ;
Add a Torrent url:
UTorrent . addTorrentUrl ( {
host : ' localhost ' ,
port : 26085 ,
username : ' admin ' ,
password : ' 12345 ' ,
torrentUrl : urlOrMagnet ,
downloadDir : 0 ,
path : ' /dir/path/ ' ,
} ) . exec ( {
error : function ( err ) {
} ,
success : function ( ) {
}
} ) ;
List all Torrents and details:
UTorrent . listTorrents ( {
host : ' localhost ' ,
port : 26085 ,
username : ' admin ' ,
password : ' 12345 ' ,
} ) . exec ( {
error : function ( err ) {
} ,
success : function ( torrents ) {
}
} ) ;
List Torrent Contents:
UTorrent . getTorrentDetails ( {
host : ' localhost ' ,
port : 26085 ,
username : ' admin ' ,
password : ' 12345 ' ,
hash : ' torrentHash '
} ) . exec ( {
error : function ( err ) {
} ,
success : function ( result ) {
}
} ) ;
Remove, start and stop torrent:
UTorrent . removeTorrent ( { ... credentials , hash : ' torrentHash ' } )
UTorrent . startTorrent ( { ... credentials , hash : ' torrentHash ' } )
UTorrent . stopTorrent ( { ... credentials , hash : ' torrentHash ' } )
Retrieve uTorrent settings:
UTorrent . getsettings ( {
host : ' localhost ' ,
port : 26085 ,
username : ' admin ' ,
password : ' 12345 '
} ) . exec ( {
error : function ( err ) {
} ,
success : function ( result ) {
}
} ) ;
OPTION NAME is the name of the setting. They are not listed here, as some of the settings (particularly advanced ones) vary with each version and most are self-explanatory
TYPE is an integer value that indicates what type of data is enclosed within the VALUE string. The following is a list of the possible TYPEs and what VALUE type it corresponds to:
0 = Integer
1 = Boolean
2 = String
Set uTorrent settings:
UTorrent . setSettings ( {
host : ' localhost ' ,
port : 26085 ,
username : ' admin ' ,
password : ' 12345 ' ,
name : settingName ,
value : settingValue
} ) . exec ( {
error : function ( err ) {
} ,
success : function ( ) {
}
} ) ;
About
This is the new mantained version of the library.
(Used by https://github.com/geco/utorrent-console )
License
MIT © 2016 contributors