Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

[fix] pixabay: crashes when there are no results

Bnyroc0ec29fdc307
diff --git a/searx/engines/pixabay.py b/searx/engines/pixabay.py
index 64c35a36f..d3c5c8532 100644
--- a/searx/engines/pixabay.py
+++ b/searx/engines/pixabay.py
@@ -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()