mirror of https://github.com/searxng/searxng.git
[enh] allow override of blocked engines from query string
This commit is contained in:
parent
b19e681cce
commit
78828efdb0
|
@ -88,18 +88,16 @@ class Query(object):
|
||||||
prefix = query_part[1:].replace('_', ' ')
|
prefix = query_part[1:].replace('_', ' ')
|
||||||
|
|
||||||
# check if prefix is equal with engine shortcut
|
# check if prefix is equal with engine shortcut
|
||||||
if prefix in engine_shortcuts\
|
if prefix in engine_shortcuts:
|
||||||
and not engine_shortcuts[prefix] in self.blocked_engines:
|
|
||||||
parse_next = True
|
parse_next = True
|
||||||
self.engines.append({'category': 'none',
|
self.engines.append({'category': 'none',
|
||||||
'name': engine_shortcuts[prefix]})
|
'name': engine_shortcuts[prefix]})
|
||||||
|
|
||||||
# check if prefix is equal with engine name
|
# check if prefix is equal with engine name
|
||||||
elif prefix in engines\
|
elif prefix in engines:
|
||||||
and prefix not in self.blocked_engines:
|
|
||||||
parse_next = True
|
parse_next = True
|
||||||
self.engines.append({'category': 'none',
|
self.engines.append({'category': 'none',
|
||||||
'name': prefix})
|
'name': prefix})
|
||||||
|
|
||||||
# check if prefix is equal with categorie name
|
# check if prefix is equal with categorie name
|
||||||
elif prefix in categories:
|
elif prefix in categories:
|
||||||
|
@ -107,7 +105,7 @@ class Query(object):
|
||||||
# are declared under that categorie name
|
# are declared under that categorie name
|
||||||
parse_next = True
|
parse_next = True
|
||||||
self.engines.extend({'category': prefix,
|
self.engines.extend({'category': prefix,
|
||||||
'name': engine.name}
|
'name': engine.name}
|
||||||
for engine in categories[prefix]
|
for engine in categories[prefix]
|
||||||
if engine not in self.blocked_engines)
|
if engine not in self.blocked_engines)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue