The package needs alldebrid previously generated API credentials:
- An app
agent
- An app
api key
They can be added either from the beginning:
const alldebrid = new Alldebrid(agent, apikey);
or later
alldebrid.setConfig(agent, apikey);
At any time you can query the current config:
alldebrid.config
You can fetch available torrent links using
alldebrid.getTorrentList().then(torrents=>...)
this command may take an optionnal filter
argument:
alldebrid.getTorrentList({regex, status}).then(torrents=>...)
regex
must be of typestring
and allows you to only query torrents with matching names (ex: /torrent name/gi)status
, anArray
ofstrings
which can be one of the following:- 'ready'
- 'downloading'
- 'removed'
- 'upload_failed'
- 'download_failed'
adding no filters will just query all torrents.
If you know the id of the torrent you want to fetch you may use it to query its status:
alldebrid.getTorrent(123456).then(torrent=>...)
If you know the id of the torrents you want to delete you may use them:
alldebrid.deleteTorrents([123456, 789101]).then(()=>...)
You can upload magnet links using
alldebrid.uploadMagnets([magnetLink1, magnetLink2])
You can unlock links from compatible websites using
alldebrid.debridLink(link, password)
alldebrid.debridLinks([link1, link2], password)
You may specify an optional password
(supported on uptobox / 1fichier).