# Description
Wrapper around qBittorrent's API to manage your torrents from Node. Documented and everything.
Installation
npm i qbittorrent-api
Overview
- Connect to host
- Add a torrent
- List torrents
- Global info
- Torrent info
- Global commands
- Torrent commands
- File commands
Documentation
Connect to host
connect(host, [username], [password])
Arguments
host
username
optionalpassword
optional
Returns
Interface object to call methods on.
Example
var api = ; var qbt = api;qbtversion { console;};
Methods
Add a torrent
add(torrent, [savePath], [label], [callback])
Arguments
torrent
- Path or URL to torrent file, Readable stream, or magnet link.savePath
optionallabel
optionalcallback
optionalerror
Example
qbt; qbt; var stream = fs;qbt; watcher;
setCookie(host, value)
Arguments
host
value
Example
qbt;qbt;
List torrents
all([label], [options], callback)
downloading([label], [options], callback)
seeding([label], [options], callback)
completed([label], [options], callback)
resumed([label], [options], callback)
paused([label], [options], callback)
active([label], [options], callback)
inactive([label], [options], callback)
queued([label], [options], callback)
errored([label], [options], callback)
Arguments
label
optional - Filter by labeloptions
optional - Additional optionssort
reverse
limit
offset
callback
error
items
Example
qbtall"Movies" sort: "size" reverse: true { items;}; qbt;
search(searchText, [options], callback)
Arguments
searchText
options
optional - Search optionsfilter
label
sort
reverse
limit
offset
callback
error
items
Example
qbt;
Get global info
version(callback)
api(callback)
apiMin(callback)
transferInfo(callback)
preferences(callback)
getGlobalDlLimit(callback)
getGlobalUpLimit(callback)
alternativeSpeedLimitsEnabled(callback)
Arguments
callback
error
data
Example
qbt;
Get torrent info
details(torrent, callback)
trackers(torrent, callback)
webseeds(torrent, callback)
files(torrent, callback)
getDlLimit(torrent, callback)
getUpLimit(torrent, callback)
Arguments
torrent
- Torrent object or hash stringcallback
error
data
Example
qbt;
Global commands
pauseAll([callback])
resumeAll([callback])
toggleAlternativeSpeedLimits([callback])
Arguments
callback
optionalerror
setGlobalDlLimit(value, [callback])
setGlobalUpLimit(value, [callback])
Arguments
value
callback
optionalerror
setPreferences(values, [callback])
Arguments
values
- Object of key-value pairs (list of keys)callback
optionalerror
Example
qbt;
Torrent commands
pause(torrents, [callback])
resume(torrents, [callback])
recheck(torrents, [callback])
delete(torrents, [callback])
deleteData(torrents, [callback])
increasePrio(torrents, [callback])
decreasePrio(torrents, [callback])
topPrio(torrents, [callback])
bottomPrio(torrents, [callback])
toggleSeqDl(torrents, [callback])
toggleFirstLastPiecePrio(torrents, [callback])
Arguments
torrents
- One or more torrent objects or hash stringscallback
optionalerror
Example
qbt;
setDlLimit(torrents, value, [callback])
setUpLimit(torrents, value, [callback])
setLabel(torrents, value, [callback])
setForceStart(torrents, value, [callback])
Arguments
torrents
- One or more torrent objects or hash stringsvalue
callback
optionalerror
Example
qbt;
addTrackers(torrents, trackers, [callback])
Arguments
torrents
- One or more torrent objects or hash stringstrackers
- Array of tracker url stringscallback
optionalerror
Example
qbt;
File commands
setFilePrio(torrent, fileId, value, [callback])
Arguments
torrent
- Single torrent object or hash stringfileId
- Index of the file in the torrent's file list (zero-based)value
0
- Do not download1
- Normal2
- High7
- Maximum
callback
optionalerror
Example
qbt;