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 b7ed25a commit 2438de0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion say/crawler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def get_data(self, need_id, force=False):
# fresh products have different api / Digikala redirect to new link for fresh product
# Typical respond: {'status': 302, 'redirect_url': {'base': None, 'uri': '/fresh/product/dkp-10269403/'}}
result = r.json
if result["status"] == 302 and "fresh" in result["redirect_url"]["uri"]:
print(result)
if result["status"] == 302 and "fresh" in result["redirect_url"]["uri"]:
url = self.API_URL_FRESH % self.dkp
if force:
r = requests.get(url)
Expand Down
1 change: 1 addition & 0 deletions say/models/need_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ def update(self,need_id, force=False):
from say.crawler import DigikalaCrawler

if 'digikala' in self.link:
print("updating via crawler.....")
data = DigikalaCrawler(self.link).get_data(need_id, force=force)
else:
data = Crawler(self.link).get_data(force=force)
Expand Down

0 comments on commit 2438de0

Please sign in to comment.