diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2022-01-30 16:30:52 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2022-01-30 16:30:52 +0100 |
commit | a6b879f19c74cd0c15907ed9d21b9185ccea9d25 (patch) | |
tree | 5083900c4be6bf00ca60bde71f68554fea21cb36 /searx/engines/tineye.py | |
parent | e92d40c854eb22f22baed9558257941057cf13fa (diff) | |
download | searxng-a6b879f19c74cd0c15907ed9d21b9185ccea9d25.tar.gz searxng-a6b879f19c74cd0c15907ed9d21b9185ccea9d25.zip |
[mod] tineye engine: set engine_type to 'online_url_search'
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/engines/tineye.py')
-rw-r--r-- | searx/engines/tineye.py | 13 |
1 files changed, 11 insertions, 2 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( { |