make search results filter configurable

This commit is contained in:
cere 2024-01-16 04:56:39 -05:00
parent 524170d97a
commit a58c71bb25

View file

@ -156,7 +156,7 @@ class PipedClient:
return self._get_json(f"/suggestions", **kwargs)
def get_search_results(self, search_query: str, **kwargs) -> t.List[str]:
def get_search_results(self, search_query: str, filter: str="all", **kwargs) -> t.List[str]:
"""
Obtains search results for a query.
@ -165,6 +165,6 @@ class PipedClient:
- `**kwargs` - Additional keyword arguments to pass to `requests.Session.get`
"""
kwargs.update({'params': {'q': search_query, 'filter': 'all'}})
kwargs.update({'params': {'q': search_query, 'filter': filter}})
return self._get_json(f"/search", **kwargs)