summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2023-09-11 09:17:55 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2023-09-13 21:41:33 +0200
commit09c61dabc9927ee075626188a93c6b2aea32a869 (patch)
tree266deb09de701427b6bfb69c7ad3d74b638aa17a /searx
parentb98907e91fbc845194580307cb23e057bdc2ac27 (diff)
downloadsearxng-09c61dabc9927ee075626188a93c6b2aea32a869.tar.gz
searxng-09c61dabc9927ee075626188a93c6b2aea32a869.zip
[mod] odysee: time range support
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/odysee.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/searx/engines/odysee.py b/searx/engines/odysee.py
index 514306f61..4b0f49375 100644
--- a/searx/engines/odysee.py
+++ b/searx/engines/odysee.py
@@ -21,6 +21,7 @@ about = {
# Engine configuration
paging = True
+time_range_support = True
results_per_page = 20
categories = ['videos']
@@ -29,6 +30,13 @@ base_url = "https://lighthouse.odysee.tv/search"
def request(query, params):
+ time_range_dict = {
+ "day": "today",
+ "week": "thisweek",
+ "month": "thismonth",
+ "year": "thisyear",
+ }
+
start_index = (params["pageno"] - 1) * results_per_page
query_params = {
"s": query,
@@ -38,6 +46,9 @@ def request(query, params):
"mediaType": "video",
}
+ if params['time_range'] in time_range_dict:
+ query_params['time_filter'] = time_range_dict[params['time_range']]
+
params["url"] = f"{base_url}?{urlencode(query_params)}"
return params