Skip to content

Commit

Permalink
feat: a warning log for svg pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanssen0 committed Dec 9, 2023
1 parent 3ad56cf commit d9d3ddf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion BotHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ async def parse_img(img_source: str):
"AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/91.4472.114 Safari/537.36"})
if res.headers.get("content-type") == "image/svg+xml":
return None
raise Exception("SVG Image")
except Exception as e:
logging.warning("Invalid image from {}: {}, You can ignore this message".format(img_source, str(e)))
return None
Expand Down

0 comments on commit d9d3ddf

Please sign in to comment.