From caebd297e9392f46c7756edfbc3e17ed9d2e19ed Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Fri, 12 May 2023 18:58:49 +0200 Subject: [PATCH] [fix] engine ddg: minor change in the API of ddg Closes: https://github.com/searxng/searxng/issues/2419 Signed-off-by: Markus Heiser --- searx/engines/duckduckgo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/searx/engines/duckduckgo.py b/searx/engines/duckduckgo.py index 4dd23c759..d37e28c2d 100644 --- a/searx/engines/duckduckgo.py +++ b/searx/engines/duckduckgo.py @@ -94,12 +94,12 @@ def get_vqd(query, headers): logger.debug("re-use cached vqd value: %s", value) return value - query_url = 'https://duckduckgo.com/?{query}&iar=images'.format(query=urlencode({'q': query})) + query_url = 'https://duckduckgo.com/?q={query}&atb=v290-5'.format(query=urlencode({'q': query})) res = network.get(query_url, headers=headers) content = res.text - if content.find('vqd=\'') == -1: + if content.find('vqd=\"') == -1: raise SearxEngineAPIException('Request failed') - value = content[content.find('vqd=\'') + 5 :] + value = content[content.find('vqd=\"') + 5 :] value = value[: value.find('\'')] logger.debug("new vqd value: %s", value) cache_vqd(query, value)