Closed Fodark closed 5 years ago
Yes it is!
What is your usecase? What are you 6 calls like?
I can't really do anything concerning that limit, nyaa.si
does not offer any official API nor documentation for theirs, all we can do is optimize our logic to reduce the number of calls. 😢
Thank you for your reply!
I'll start saying that today I'm not having this problem, the calls respond successfully, weird.
I wrote a program to check if the latest episode of the seasonal animes I follow was released on nyaa, so I have a call for each one (they're six) delayed by setInterval, the relevant pieces of code are these:
setInterval(() => {
let name = anime[i]
searchAnime(i++, name, info[name])
}, 6000)
And in searchAnime
function:
si.search('[HorribleSubs] ' + name, 20, { category: '1_2' })
.then(data => {
...
}
So I cannot really reduce the number of calls...
Since today it has no problem I'm wondering if it was a temporary problem of mine with my line
Actually you can do all that in only one request!
The Help section shows how to use the nyaa.si search engine. nyaapi
does respect this so you can do this for example:
const { si } = require('nyaapi')
si.search('([HorribleSubs]) "Sakura Trick"|"Made in Abyss"')
.then(console.log)
.catch(console.error)
This will give these results.
Sorry for my late reply, I'll look how to implement this in my program! Thank you for your time!
No problem, feel free to update this issue whenever you tried this 😄
Nyaa.si implemented a DDoS protection system, which most of the times blocks requests from your package. Sometimes they get through and I get a response but even if I wait 6 seconds between each call (usually I make 6 calls totally in my application) they're blocked. I don't know if it a matter of user-agent.
I hope the project is still active!