offcloud-api
v2.0.0
Published
Node Offcloud API wrapper
Readme
node-offcloud
Node wrapper for the Offcloud API.
npm install offcloud-api --saveconst OffcloudClient = require('offcloud-api')
const OC = new OffcloudClient('YOUR_API_KEY') // sent as `Authorization: Bearer`
// Cache: check availability + get instant download links for cached magnets
OC.cache.info(['magnet:?xt=urn:btih:...'], true).then(results => console.log(results))
OC.cache.download('magnet:?xt=urn:btih:...').then(files => console.log(files))
// Cloud: queue a magnet/URL for download when it's not cached
OC.cloud.download('magnet:?xt=urn:btih:...').then(({ requestId }) => console.log(requestId))
OC.cloud.status(requestId).then(({ status }) => console.log(status.status))
OC.cloud.explore(requestId).then(({ files }) => console.log(files))
OC.cloud.history().then(results => console.log(results))
// Account
OC.account.info().then(info => console.log(info))