From c9a68fe8c5301aa8398eb2845197b2c990257efe Mon Sep 17 00:00:00 2001 From: ehsang Date: Sun, 1 Dec 2024 22:32:55 +0330 Subject: [PATCH] tasks bug fix --- say/crawler/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/say/crawler/__init__.py b/say/crawler/__init__.py index 8b74c070..c95834c0 100644 --- a/say/crawler/__init__.py +++ b/say/crawler/__init__.py @@ -130,7 +130,7 @@ def get_data(self, force=False): # fresh products have different api / Digikala redirect to new link for fresh product # Typical response: {'status': 302, 'redirect_url': {'base': None, 'uri': '/fresh/product/dkp-10269403/'}} - if result["status"] == 302 and "fresh" in result["redirect_url"]["uri"]: + if result and result["status"] == 302 and "fresh" in result["redirect_url"]["uri"]: url = self.API_URL_FRESH % self.dkp if force: r = requests.get(url)