Skip to content

Commit

Permalink
celeray task
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Sep 15, 2024
1 parent 560895a commit 6367f73
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions say/crawler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,20 @@ def get_data(self, need_id, force=False):
r = requests.get(url)
else:
r = request_with_cache(url)
if r.status_code != 200:
if r.status != 200:
print(r)
if r.status_code == 302 and "fresh" in r["redirect_url"]["uri"]:
if r.status == 302 and "fresh" in r["redirect_url"]["uri"]:
print("Checking if fresh product...")
url = self.API_URL_FRESH % self.dkp
if force:
r = requests.get(url)
else:
r = request_with_cache(url)
if r.status_code != 200:
if r.status != 200:
print("Could not call the digikala api", need_id )
return
else:
return
print(url)

data = r.json()['data']
Expand Down

0 comments on commit 6367f73

Please sign in to comment.