mirror of
https://github.com/searxng/searxng.git
synced 2026-09-23 06:36:12 +00:00
[fix] pixabay: crashes when there are no results
This commit is contained in:
@@ -77,9 +77,9 @@ def _video_result(result):
|
||||
def response(resp):
|
||||
results = []
|
||||
|
||||
# if there are no results on this page, we get a redirect
|
||||
# to the first page
|
||||
if resp.status_code == 302:
|
||||
# if there are no results on this page, we get a redirect to the first page
|
||||
# or if it's the first page, to an "auto-corrected" query (i.e. spelling changed)
|
||||
if 300 <= resp.status_code < 400:
|
||||
return results
|
||||
|
||||
json_data = resp.json()
|
||||
|
||||
Reference in New Issue
Block a user