From a6b879f19c74cd0c15907ed9d21b9185ccea9d25 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 30 Jan 2022 16:30:52 +0100 Subject: [PATCH] [mod] tineye engine: set engine_type to 'online_url_search' Signed-off-by: Markus Heiser --- searx/engines/tineye.py | 13 +++++++++++-- searx/settings.yml | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/searx/engines/tineye.py b/searx/engines/tineye.py index 302aea326..5a8c86062 100644 --- a/searx/engines/tineye.py +++ b/searx/engines/tineye.py @@ -28,7 +28,8 @@ about = { "results": 'JSON', } -categories = ['images'] +engine_type = 'online_url_search' +categories = ['general'] paging = True safesearch = False base_url = 'https://tineye.com' @@ -36,8 +37,16 @@ search_string = '/result_json/?page={page}&{query}' def request(query, params): + + if params['search_urls']['data:image']: + query = params['search_urls']['data:image'] + elif params['search_urls']['http']: + query = params['search_urls']['http'] + + query = urlencode({'url': query}) + # see https://github.com/TinEye/pytineye/blob/main/pytineye/api.py - params['url'] = base_url + search_string.format(query=urlencode({'url': query}), page=params['pageno']) + params['url'] = base_url + search_string.format(query=query, page=params['pageno']) params['headers'].update( { diff --git a/searx/settings.yml b/searx/settings.yml index 60b8b8278..ac320c457 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -487,7 +487,7 @@ engines: engine: tineye shortcut: tin timeout: 9.0 - disabled: true + disabled: false - name: etymonline engine: xpath