Skip to content

Commit

Permalink
retialer 403 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-g committed Dec 7, 2024
1 parent 3aa71f8 commit 91fddfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions say/crawler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ def __init__(self, url):
def call_api(self, url):
try:
# Run the wget command and capture the output
print("result")
result = subprocess.run(['wget', '-qO-', url], capture_output=True, text=True, check=True)
print(result)
return result.stdout
except subprocess.CalledProcessError as e:
return f"An error occurred: {e}"
Expand All @@ -135,14 +133,16 @@ def parse_result(self, api_response):
except json.JSONDecodeError as e:
return f"An error occurred while parsing JSON: {e}"

def get_data(self, force=False):
def get_data(self, force):
result = None
parsed_result = None

if self.dkp is None:
return

url = self.API_URL_NOT_FRESH % self.dkp
print("url:")
print(url)
api_response = self.call_api(url)
parsed_result = self.parse_result(api_response)

Expand Down

0 comments on commit 91fddfe

Please sign in to comment.