From 66fce36a48bd58d50dec61b996ee5cc4ae6cdc6e Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 27 Feb 2017 19:17:43 +0100 Subject: don't fail with 404 if a player was found --- crawler.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crawler.py') diff --git a/crawler.py b/crawler.py index fc09aca..6a588c7 100644 --- a/crawler.py +++ b/crawler.py @@ -71,6 +71,11 @@ class Crawler(object): if "errors" in res: logging.warn("API returned error: '%s'", res["errors"]) + if res["errors"][0].get("title") == "Not Found" \ + and params["page[offset]"] > 0: + # a query returned exactly 50 matches + # which is expected, so don't fail. + return raise ApiError(res["errors"]) yield res -- cgit v1.3.1