Browse Source

[fix] mojeek web engine: don't add empty fmt argument for web searches

Empty ``&fmt=`` argument triggers an automated tools detection from mojeek.

Suggested-by: @shinodark in https://github.com/searxng/searxng/issues/4307#issuecomment-2669355322
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Markus Heiser 3 months ago
parent
commit
44d941c93c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      searx/engines/mojeek.py

+ 3 - 1
searx/engines/mojeek.py

@@ -67,11 +67,13 @@ def request(query, params):
     args = {
         'q': query,
         'safe': min(params['safesearch'], 1),
-        'fmt': search_type,
         language_param: traits.get_language(params['searxng_locale'], traits.custom['language_all']),
         region_param: traits.get_region(params['searxng_locale'], traits.custom['region_all']),
     }
 
+    if search_type:
+        args['fmt'] = search_type
+
     if search_type == '':
         args['s'] = 10 * (params['pageno'] - 1)