diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2023-09-02 09:26:45 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2023-09-02 09:26:45 +0200 |
commit | 4f8895c6de2659f9ca069dde7be8eb3714ed1494 (patch) | |
tree | 779bd49b1c4a7a783fbcfab6d246b97907b1346f | |
parent | 4da7003ae0316c98be66f5f2921c4eb3606b70e3 (diff) | |
download | searxng-4f8895c6de2659f9ca069dde7be8eb3714ed1494.tar.gz searxng-4f8895c6de2659f9ca069dde7be8eb3714ed1494.zip |
[fix] follow-up of 4da7003ae / add missing review from @Bnyro
[1] https://github.com/searxng/searxng/pull/2656#pullrequestreview-1607956209
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
-rw-r--r-- | searx/engines/odysee.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/searx/engines/odysee.py b/searx/engines/odysee.py index 3450c30da..514306f61 100644 --- a/searx/engines/odysee.py +++ b/searx/engines/odysee.py @@ -6,6 +6,7 @@ """ import time +from urllib.parse import urlencode from datetime import datetime # Engine metadata @@ -21,16 +22,14 @@ about = { # Engine configuration paging = True results_per_page = 20 -categories = ['images'] +categories = ['videos'] # Search URL (Note: lighthouse.lbry.com/search works too, and may be faster at times) base_url = "https://lighthouse.odysee.tv/search" -# Request function -def request(query, params): - page = params.get("pageno", 1) - 1 - start_index = page * results_per_page +def request(query, params): + start_index = (params["pageno"] - 1) * results_per_page query_params = { "s": query, "size": results_per_page, @@ -39,8 +38,7 @@ def request(query, params): "mediaType": "video", } - query_str = "&".join([f"{key}={value}" for key, value in query_params.items()]) - params["url"] = f"{base_url}?{query_str}" + params["url"] = f"{base_url}?{urlencode(query_params)}" return params |