nyaapi
Version:
Non-official api for getting torrent links from Nyaa.si and Nyaa.pantsu.cat
20 lines (15 loc) • 370 B
JavaScript
/**
* Request torrent information according to its ID.
*
* @param {number} id The ID of the torrent you want information of.
*
* @returns {promise}
*/
async function infoRequest (id) {
if (!id) throw new Error('[Nyaapi]: No ID given on request demand.')
const { data } = await this.cli.get(`/view/${id}`)
return data
}
module.exports = {
infoRequest
}