An HorribleSubs API wrapper to get data from horriblesubs.info.
npm install --save horriblesubs-api
const HorribleSubsApi = require('horriblesubs-api')
// Create a new instance of the module.
const horriblesubs = new HorribleSubsApi({
baseUrl, // The base url of horriblesubs. Defaults to 'https://horriblesubs.info/'.
debug // Show extra output. Defaults to 'false'.
})
// Get all available shows on horriblesubs.
horriblesubs.getAllAnime().then(res => {
const [ data ] = res
console.log(data)
// Get data including episodes from horriblesubs.
return horriblesubs.getAnimeData(data)
}).then(res => console.log(res))
.catch(err => console.error(err))
[{
link: '/shows/91-days',
slug: '91-days',
title: '91 Days'
}, {
link: '/shows/absolute-duo',
slug: 'absolute-duo',
title: 'Absolute Duo'
}, ...]
{ link: '/shows/91-days',
slug: 'ninety-one-days',
title: '91 Days',
hs_showid: '731',
episodes:
{ '1':
{ '1':
{ '480':
{ url: 'magnet:?xt=urn:btih:AYIJKPLP5WVVF36O25JBB3FFPNJEBBPQ&tr=http://open.nyaatorrents.info:6544/announce&tr=udp://tracker.openbittorrent.com:80/announce&tr=udp://tracker.coppersurfer.tk:6969/announce',
seeds: 0,
peers: 0,
provider: 'HorribleSubs' } },
...
}
}
}
Nested within the episodes
property there is the season number
within the season number
is the episode number
and within the
episode number
are the different qualities
of the torrent.
You can run tests with the following npm command:
$ npm test
MIT License