summaryrefslogtreecommitdiff
path: root/searx/search/models.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2021-03-25 09:37:37 +0100
committerAlexandre Flament <alex@al-f.net>2021-03-25 09:37:37 +0100
commit0b45afd4d7f23cbbc33376b861103f54c5c9f856 (patch)
tree2f794d533f6731c461ca83111563b492bc1eee91 /searx/search/models.py
parent06b754ad67aa6066aed6df77b5ffb74aabebb040 (diff)
downloadsearxng-0b45afd4d7f23cbbc33376b861103f54c5c9f856.tar.gz
searxng-0b45afd4d7f23cbbc33376b861103f54c5c9f856.zip
[fix] checker: various bug fixes
* initialize engine_data (youtube engine) * don't crash if an engine don't set result['url']
Diffstat (limited to 'searx/search/models.py')
-rw-r--r--searx/search/models.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/searx/search/models.py b/searx/search/models.py
index 21c0fe590..7233fac42 100644
--- a/searx/search/models.py
+++ b/searx/search/models.py
@@ -36,7 +36,7 @@ class SearchQuery:
time_range: typing.Optional[str]=None,
timeout_limit: typing.Optional[float]=None,
external_bang: typing.Optional[str]=None,
- engine_data: typing.Optional[dict]=None):
+ engine_data: typing.Optional[typing.Dict[str, str]]=None):
self.query = query
self.engineref_list = engineref_list
self.lang = lang
@@ -45,9 +45,7 @@ class SearchQuery:
self.time_range = time_range
self.timeout_limit = timeout_limit
self.external_bang = external_bang
- self.engine_data = engine_data
- if engine_data is None:
- self.engine_data = {}
+ self.engine_data = engine_data or {}
@property
def categories(self):