[fix] pixabay: crashes when there are no results

This commit is contained in:
Bnyro
2026-09-18 12:01:58 +02:00
parent 579809a053
commit c0ec29fdc3

View File

@@ -77,9 +77,9 @@ def _video_result(result):
def response(resp): def response(resp):
results = [] results = []
# if there are no results on this page, we get a redirect # if there are no results on this page, we get a redirect to the first page
# to the first page # or if it's the first page, to an "auto-corrected" query (i.e. spelling changed)
if resp.status_code == 302: if 300 <= resp.status_code < 400:
return results return results
json_data = resp.json() json_data = resp.json()