Skip to content

Commit

Permalink
Merge pull request #17 from mizaki/cf
Browse files Browse the repository at this point in the history
Add CloudFlare detection for failed image fetches
  • Loading branch information
mizaki authored May 28, 2024
2 parents 39f0037 + bc31d8f commit 78d4a34
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gcd_talker/gcd.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,11 @@ def _find_issue_images(self, issue_id: int) -> tuple[str, list[str]]:
else:
variants.append(src)
else:
# TODO check for cloudflare activation and log
logger.debug(f"No image found for ID: {issue_id}")
cf_challenge = covers_page.findAll(id="challenge-error-title")
if cf_challenge:
logger.info(f"CloudFlare active, cannot access image for ID: {issue_id}")
else:
logger.info(f"No image found for ID: {issue_id}")

return cover, variants

Expand Down

0 comments on commit 78d4a34

Please sign in to comment.