diff options
author | Alexandre Flament <alex@al-f.net> | 2021-03-25 09:37:37 +0100 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-03-25 09:37:37 +0100 |
commit | 0b45afd4d7f23cbbc33376b861103f54c5c9f856 (patch) | |
tree | 2f794d533f6731c461ca83111563b492bc1eee91 /searx/search/models.py | |
parent | 06b754ad67aa6066aed6df77b5ffb74aabebb040 (diff) | |
download | searxng-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.py | 6 |
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): |