UNPKG

stremio-addon-client

Version:

Client library for using stremio addons (v3 protocol)

42 lines (30 loc) 940 B
#!/usr/bin/env node var AddonClient = require('../lib/client') var errors = require('../lib/errors') var tape = require('tape') var addon tape('detectFromURL: detect and use manifest.json URL - running locally', function(t) { AddonClient.detectFromURL('http://openbtindex.io/manifest.json') .then(function(resp) { t.ok(resp, 'has response') t.ok(resp.addon, 'has addon') addon = resp.addon t.end() }) }) tape('can get stream/movie/{id}', function(t) { return addon.get('stream', 'movie', 'tt0816692') .then(function(resp) { t.ok(Array.isArray(resp), 'response is an array') t.ok(resp.length > 0, 'response has at least one result') t.end() }) }) tape('can get stream/series/{id}', function(t) { return addon.get('stream', 'series', 'tt0898266:1:3') .then(function(resp) { t.ok(Array.isArray(resp), 'response is an array') t.ok(resp.length > 0, 'response has at least one result') t.end() }) })