From a58c71bb25298301f867897cf1c04e1b971b8316 Mon Sep 17 00:00:00 2001 From: cere Date: Tue, 16 Jan 2024 04:56:39 -0500 Subject: [PATCH] make search results filter configurable --- piped_api/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piped_api/client.py b/piped_api/client.py index c7c3137..4f4a242 100644 --- a/piped_api/client.py +++ b/piped_api/client.py @@ -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) \ No newline at end of file