Skip to content
main
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

SABnzbd-API

SABnzbd API client written in TypeScript licensed under the MIT. It supports most of the API calls listed in the version 3.1.1 documentation (https://sabnzbd.org/wiki/advanced/api). It's still under active development and will soon support the remaining functions.

GitHub license npm version CircleCI

Features

  • Written in TypeScript
  • Promise based API
  • Supports adding files via multi-part form data using the FormData library.

Dependencies

Installation

npm install --save sabnzbd-api

Documentation

You can find the API documentation at https://zordtk.github.io/sabnzbd-api/docs/, you should also read SABnzbd's API documentation at https://sabnzbd.org/wiki/advanced/api

Usage

version()

const SABnzbd = require("sabnzbd-api");
let client    = new SABnzbd.Client("http://example.com/sabnzbd", "apikey");
client.version().then(version => {
    console.log(version);
}).catch(error => {
    console.log(error.message);
});

addUrl()

const SABnzbd = require("sabnzbd-api");
let client    = new SABnzbd.Client("http://example.com/sabnzbd", "apikey");
client.addUrl('url-to-nzb').then(results => {
    if( results.status )
        console.log('Added NZB');
    else
        console.log('Failed to add NZB: ' + results.error);
}).catch(error => {
    console.log(error.message);
});

addFile()

const SABnzbd   = require("sabnzbd-api");
const fs        = require("fs");
const FormData  = require("form-data");
let client      = new SABnzbd.Client("http://example.com/sabnzbd", "apikey");
let formData    = new FormData();

formData.append("name", fs.createReadStream("/path/to/file"));
client.addFile(formData).then(results => {
    if( results.status )
        console.log('Added NZB');
    else
        console.log('Failed to add NZB: ' + results.error);
}).catch(error => {
    console.log(error.message);
});

Todo

  • Status functions (added in SABnzbd v3.4.0, currently in development)
  • Status information (added in SABnzbd v3.4.0, currently in development)
  • Orphaned Jobs

About

SABnzbd API client written in TypeScript and licensed under the MIT.

Resources

License

Packages

No packages published