summaryrefslogtreecommitdiff
path: root/searx/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/utils.py')
-rw-r--r--searx/utils.py8
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]