diff options
author | Adam Tauber <asciimoo@gmail.com> | 2015-01-31 23:11:45 +0100 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2015-01-31 23:11:45 +0100 |
commit | b19e681cce9cef4993b17d3a89d743208f8d5c05 (patch) | |
tree | a9ea7c3a44c25bc74ac5cbb1e379545be1902a0b /searx/utils.py | |
parent | bfd321a7a9cfc6d643fdebe5e7a5824fe70b9aa9 (diff) | |
download | searxng-b19e681cce9cef4993b17d3a89d743208f8d5c05.tar.gz searxng-b19e681cce9cef4993b17d3a89d743208f8d5c05.zip |
[enh] default disabled engines - closes #109
Diffstat (limited to 'searx/utils.py')
-rw-r--r-- | searx/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/searx/utils.py b/searx/utils.py index cd2392b9d..c47d3be17 100644 --- a/searx/utils.py +++ b/searx/utils.py @@ -225,3 +225,11 @@ def prettify_url(url): return u'{0}[...]{1}'.format(url[:35], url[-35:]) else: return url + + +def get_blocked_engines(engines, cookies): + if 'blocked_engines' not in cookies: + return [engine for engine in engines if engines[engine].disabled] + + return [engine for engine in cookies.get('blocked_engines', '').split(',') + if engine in engines] |