Closed Arweix closed 2 years ago
Hello! Thank you for pointing this out, this is indeed a bug. The value should be searchFilter
instead of just filter
.
After this change, your code should look like this:
from cursepy import CurseClient
client = CurseClient()
search = client.get_search()
search.pageSize = 5
search.searchFilter = "witchery" # Here is the changed line, use 'searchFilter' instead of 'filter'
for i in client.search(432, client.ADDON_SEARCH, search):
print(i.name)
After applying the change, here are my results when running your code:
Witchery
Witchery: Rewitched
WitcheryPatch
Witchery- Style Vampirism
Witchery Master Patch
You can now upgrade cursepy via pip and it will work, the specific version you want is 1.1.3
.
Also just a side note, the category ID for the search method should not be a handler ID such as ADDON_SEARCH
, and instead should be a valid category ID. You can find all valid Minecraft IDs by using the categories()
method on a CurseGame
instance like so:
client.game(423).categories()
Alternatively, you can use the MinecraftWrapper
class, which auto fills most of this info for you. Here is an example of searching the modpack category:
from cursepy import MinecraftWrapper
client = MinecraftWrapper()
search = client.get_search()
search.searchFilter = "Test"
client.search_modpacks(search)
Thanks again for pointing this out! I really appreciate it. please let me know if this issue or any others make themselves known.
Thanks for fixing the bug! How it works, I'll take note of Minecraft Wrapper. A very convenient and useful thing! Good luck :)
My code:
Output:
It looks like the search filter is not working