diff options
author | Markus Heiser <markus.heiser@darmarIT.de> | 2023-05-13 05:55:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 05:55:33 +0200 |
commit | 19ce3d88ce70027b0e91ce989c0ce904bbab8897 (patch) | |
tree | 745a2370f41f5d412771c585bfeea6677c9e74a5 | |
parent | cb1c3741d7de1354b524589114617f183009f6a8 (diff) | |
parent | caebd297e9392f46c7756edfbc3e17ed9d2e19ed (diff) | |
download | searxng-19ce3d88ce70027b0e91ce989c0ce904bbab8897.tar.gz searxng-19ce3d88ce70027b0e91ce989c0ce904bbab8897.zip |
Merge pull request #2430 from return42/fix-2419-ddg
[fix] engine ddg: minor change in the API of ddg
-rw-r--r-- | searx/engines/duckduckgo.py | 6 |
1 files 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) |