JuanjoSalvador / NyaaPy

Unofficial Python wrapper for Nyaa anime torrent sites
MIT License
47 stars 23 forks source link

No filter documentation #55

Open superlazer opened 3 years ago

superlazer commented 3 years ago

I would really appreciate it if I could see the filter list to know what I can filter. Right now it is just an empty doc.

Cheers

JuanjoSalvador commented 3 years ago

I was postponing writing the docs for a long time, because I didn't know this project has actual users. So I'm going to write them along this week, I promise. Also there is a lot of new and undocumented features, and lot of outdated/deprecated ones.

The filters are basically three:

0 - No filter (default)
1 - No remakes
2 - Trusted only

So if you want to search for Kimi No Na Wa for example at Nyaa.si but you only want trusted results, you can use

from NyaaPy.nyaa import Nyaa

# Initialize Nyaa object
nyaa = Nyaa()

# Search for `Kimi No Na Wa` at Nyaa
nyaa.search("kimi no na wa", filters=2)

Which is an equivalent to make a request to https://nyaa.si/?f=2&c=0_0&q=Kimi+No+Na+Wa. Notice f=2 into the URL.