summaryrefslogtreecommitdiff
path: root/searx/query.py
diff options
context:
space:
mode:
authorNoémi Ványi <sitbackandwait@gmail.com>2020-02-01 11:01:17 +0100
committerNoémi Ványi <sitbackandwait@gmail.com>2020-02-08 11:47:39 +0100
commit99435381a84072b110c32004b2fb778af9b96f77 (patch)
tree9ad5fd222e6717312ef05dbcd871ef46a97857e5 /searx/query.py
parentf9c7a678d273c55a0e8a1a7a2dbfd696b2046e60 (diff)
downloadsearxng-99435381a84072b110c32004b2fb778af9b96f77.tar.gz
searxng-99435381a84072b110c32004b2fb778af9b96f77.zip
[enh] introduce private engines
This PR adds a new setting to engines named `tokens`. It expects a list of tokens which lets searx validate if the request should be accepted or not.
Diffstat (limited to 'searx/query.py')
-rw-r--r--searx/query.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/searx/query.py b/searx/query.py
index c4002bd31..79afa0245 100644
--- a/searx/query.py
+++ b/searx/query.py
@@ -177,7 +177,8 @@ class RawTextQuery(object):
class SearchQuery(object):
"""container for all the search parameters (query, language, etc...)"""
- def __init__(self, query, engines, categories, lang, safesearch, pageno, time_range, timeout_limit=None):
+ def __init__(self, query, engines, categories, lang, safesearch, pageno, time_range,
+ timeout_limit=None, preferences=None):
self.query = query.encode('utf-8')
self.engines = engines
self.categories = categories
@@ -186,6 +187,7 @@ class SearchQuery(object):
self.pageno = pageno
self.time_range = None if time_range in ('', 'None', None) else time_range
self.timeout_limit = timeout_limit
+ self.preferences = preferences
def __str__(self):
return str(self.query) + ";" + str(self.engines)