diff options
author | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-02-08 21:53:37 +0100 |
---|---|---|
committer | Thomas Pointhuber <thomas.pointhuber@gmx.at> | 2015-02-08 21:53:37 +0100 |
commit | e7de9674b14c2ff06fac009274742819d6468138 (patch) | |
tree | 6a0de8ca26494c2cb6b9c5028ec2ad45cd1e20d9 /searx/search.py | |
parent | dd4686a3886458f600427aba0ed7b9666b3644db (diff) | |
download | searxng-e7de9674b14c2ff06fac009274742819d6468138.tar.gz searxng-e7de9674b14c2ff06fac009274742819d6468138.zip |
[enh] add safesearch functionality
2 = strict
1 = moderate
0 = none
Diffstat (limited to 'searx/search.py')
-rw-r--r-- | searx/search.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/searx/search.py b/searx/search.py index 1b16ee02f..79a8ae0a9 100644 --- a/searx/search.py +++ b/searx/search.py @@ -457,6 +457,11 @@ class Search(object): request_params['started'] = time() request_params['pageno'] = self.pageno request_params['language'] = self.lang + try: + # 0 = None, 1 = Moderate, 2 = Strict + request_params['safesearch'] = int(request.cookies.get('safesearch', 1)) + except ValueError: + request_params['safesearch'] = 1 # update request parameters dependent on # search-engine (contained in engines folder) |