summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-01-07 14:08:19 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-01-07 14:14:31 +0100
commit4fc5e5299c06a942d3650f2e45ac0a11b51d917e (patch)
tree93d6bd0e7e8022d27006d145601bc21bacee580c /searx
parent1461d6a07ec2e4a060035a6843804bff65ca06a8 (diff)
downloadsearxng-4fc5e5299c06a942d3650f2e45ac0a11b51d917e.tar.gz
searxng-4fc5e5299c06a942d3650f2e45ac0a11b51d917e.zip
[fix] ccengine engine - avoid unwanted redirects
api.openverse.engineering is a little picky and wants to have a trailing slash in the path: /v1/images? -->/ v1/images/? otherwise it redirects, here is the debug log: DEBUG searx.network.openverse : HTTP Request: GET https://api.openverse.engineering/v1/images?&page=1&page_size=20&format=json&q=foo "HTTP/2 301 Moved Permanently" (text/html; charset=utf-8) DEBUG searx.network.openverse : HTTP Request: GET https://api.openverse.engineering/v1/images/?&page=1&page_size=20&format=json&q=foo "HTTP/2 200 OK" (application/json) WARNING searx.engines.openverse : ErrorContext('searx/search/processors/online.py', 105, 'count_error(', None, '1 redirects, maximum: 0', ('200', 'OK', 'api.openverse.engineering')) True Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/openverse.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/engines/openverse.py b/searx/engines/openverse.py
index 0b12ecd5e..9f4636e41 100644
--- a/searx/engines/openverse.py
+++ b/searx/engines/openverse.py
@@ -23,8 +23,8 @@ categories = ['images']
paging = True
nb_per_page = 20
-base_url = 'https://api.openverse.engineering/v1/images?'
-search_string = '&page={page}&page_size={nb_per_page}&format=json&{query}'
+base_url = 'https://api.openverse.engineering/v1/images/'
+search_string = '?page={page}&page_size={nb_per_page}&format=json&{query}'
def request(query, params):