diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2023-03-29 16:18:02 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2023-03-29 16:18:02 +0200 |
commit | 2b8dfab33f656076b607440c0a72d1462b8b4299 (patch) | |
tree | e44b4fa868ae63a9a01dfe23fa4719113602a25a /searx | |
parent | d179b62cf5f668945693a673f2238f63687a6e08 (diff) | |
download | searxng-2b8dfab33f656076b607440c0a72d1462b8b4299.tar.gz searxng-2b8dfab33f656076b607440c0a72d1462b8b4299.zip |
[fix] engine gigablast: add &userid=<User ID>&code=<Feed Code>
Gigablast's API does block unauthorized request[1].
[1] https://gigablast.com/searchfeed.html
Closes: https://github.com/searxng/searxng/issues/1454
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/gigablast.py | 7 | ||||
-rw-r--r-- | searx/settings.yml | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py index 382711b10..e90098101 100644 --- a/searx/engines/gigablast.py +++ b/searx/engines/gigablast.py @@ -39,6 +39,9 @@ extra_param_ts = 0 # after how many seconds extra_param expire extra_param_expiration_delay = 3000 +gb_userid = '' +gb_code = '' + def fetch_extra_param(query_args, headers): @@ -71,6 +74,10 @@ def fetch_extra_param(query_args, headers): def request(query, params): # pylint: disable=unused-argument query_args = dict(c='main', q=query, dr=1, showgoodimages=0) + if gb_userid and gb_code: + query_args['userid'] = gb_userid + query_args['code'] = gb_code + if params['language'] and params['language'] != 'all': query_args['qlangcountry'] = params['language'] query_args['qlang'] = params['language'].split('-')[0] diff --git a/searx/settings.yml b/searx/settings.yml index fabd87bad..544f39a71 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -674,6 +674,9 @@ engines: engine: gigablast shortcut: gb timeout: 4.0 + # API key required, see https://gigablast.com/searchfeed.html + # gb_userid: unset + # gb_code: unknown disabled: true additional_tests: rosebud: *test_rosebud |