Skip to content

Commit

Permalink
fix: Catch JS page.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Mar 11, 2024
1 parent 059c0e1 commit 4e0e71c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ def _fetch(self) -> Path | None:
response = requests.get(self.json_db_url, headers=headers)
self.logger.info('Fetching done.')
if content := response.content:
if content[0] == b'<':
self.logger.error('Got the dumb JS page, will try again later...')
return None

try:
json_response = json.loads(bz2.decompress(content))
except Exception as e:
Expand Down

0 comments on commit 4e0e71c

Please sign in to comment.