-
Notifications
You must be signed in to change notification settings - Fork 17
Nyaa.pantsu.cat
Please check out the official nyaa.pantsu.cat's api documentation for all the available options for each methods.
All the results given by nyaapi are as described in the corresponding method on the nyaa pantsu's api.
If you find any encounter problem, do no hesitate to post an issue in the issue section.
const {pantsu} = require('nyaapi')
[Pantsu] methods:
pantsu.search(term, n = null, opts = {})
The opts
parameter accepts every parameter just as the docs says.
There are two ways of using this method.
- 3 arguments
pantsu.search('HorribleSubs', 20, {
order: true,
sort: '4'
})
.then((data) => console.log(data))
.catch((err) => console.log(err))
- 1 object argument
pantsu.search({
term: 'HorribleSubs',
n: 20,
order: true,
sort: '4'
})
.then((data) => console.log(data))
.catch((err) => console.log(err))
If no n
parameter is given, nyaapi will call the searchAll
method with the same term
and options
.
pantsu.searchAll(term, opts = {})
The opts
parameter accepts every parameter just as the docs says.
There are two ways of using this method.
- 2 arguments
pantsu.searchAll('HorribleSubs', {
order: true,
sort: '4'
})
.then((data) => console.log(data))
.catch((err) => console.log(err))
- 1 object argument
pantsu.searchAll({
term: 'HorribleSubs',
order: true,
sort: '4'
})
.then((data) => console.log(data))
.catch((err) => console.log(err))
pantsu.infoRequest(id)
pantsu.infoRequest(537126)
.then((data) => console.log(data))
.catch((err) => console.log(err))
pantsu.checkUser(id)
pantsu.checkUser(12035)
.then((data) => console.log(data))
.catch((err) => console.log(err))
pantsu.checkHeader(id)
pantsu.checkHeader(my_id)
.then((data) => console.log(data))
.catch((err) => console.log(err))
pantsu.login(credentials)
pantsu.login({
username: 'my_super_username',
password: 'my_super_secret_password'
})
.then((data) => console.log(data))
.catch((err) => console.log(err))
pantsu.upload(opts)
The opts
parameter accepts every parameter just as the docs says.
There are two ways of using this method.
pantsu.upload({
token: 'my_token',
username: 'my_super_username',
magnet: '<magnet_hash>', # Only if you want to upload via a magnet!
torrent: '<absolute_path_to_file>', # Only if you want to upload a torrent file!
})
.then((data) => console.log(data))
.catch((err) => console.log(err))
pantsu.update(opts)
The opts parameter accepts every parameter just as the docs says.
There are two ways of using this method.
pantsu.update({
token: 'my_token',
username: 'my_super_username',
id: '<Torrent ID>',
name: 'A new name',
...otherOptions...
})
.then((data) => console.log(data))
.catch((err) => console.log(err))