torget
v0.0.5
Published
A Node.js torrent file picker and downloader
Downloads
2
Readme
torget
A Node.js torrent file picker and downloader.
##Quick Start For example, if you want to download a Ubuntu Server torrent file, you could do the following:
var torget = require('torget');
torget('ubuntu server', null, function(err, filename) {
if (err) {
console.log(err);
process.exit(1);
} else {
console.log('great success! Saved as: ' + filename);
process.exit(0);
}
});
Or, if you are using torget directly from the command line, you could do:
$ torget ubuntu server
This will launch an interactive mode where you can see a table with the search results and select which torrent to download. Ctrl+c to cancel. You can add the --auto command to avoid the interactive seleciton process. In --auto mode, the first result will be returned.
##Installation torget requires node.js and npm to run. To install, simply run:
npm install torget
If you want a global install so that you can run torget from the shell anywhere on your system, then add the -g flag to the previous command:
npm install -g torget
##API
###torget(query, options, callback) Automatically search, select and download torrent file
query
a search queryoptions
options object described below - can be omittedcallback
function(err, filename) - err is none on success.
###torget.select(query, options, callback) Automatically search and select torrent, but return torrent object instead of downloading
query
a search queryoptions
options object described below - can be omittedcallback
function(err, torrent) - err is none on success.
###torget.interactive(query, options, callback) Search and select a torrent interactively, but return torrent object instead of downloading
query
a search queryoptions
options object described below - can be omittedcallback
function(err, torrent) - err is none on success.
###torget.search(query, callback) Search and return list of torrent objects
query
a search querycallback
function(err, results) - err is none on success.
###torget.download(torrent, options, callback) Download a torrent file to disk using torcache.js.
torrent
a torrent object yielded from select/interactive or search methods. Must contain hash and title.options
options object described below - can be omittedcallback
function(err, filename) - err is none on success.
###options
n
max number of results to displayp
torrent file download patha
auto donwload flag
###torrent
title
category
link
guid
pubDate
torrentLink
files
# of filescomments
# of commentshash
peers
# of peersseeds
# of seedsleechs
# of leechssize
in bytesvotes
# of votesverified
1 or 0