From 1ee2eae499b79bf0d22212184bffd57d873826cc Mon Sep 17 00:00:00 2001 From: Kyomotoi <0w0@imki.moe> Date: Fri, 2 Dec 2022 08:52:19 +0800 Subject: =?UTF-8?q?=F0=9F=8E=A8=20=E9=87=8D=E6=9E=84=E6=B6=A9=E5=9B=BE?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/setu/nsfw_checker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ATRI/plugins/setu/nsfw_checker.py') diff --git a/ATRI/plugins/setu/nsfw_checker.py b/ATRI/plugins/setu/nsfw_checker.py index c0bd2ba..53546f6 100644 --- a/ATRI/plugins/setu/nsfw_checker.py +++ b/ATRI/plugins/setu/nsfw_checker.py @@ -40,14 +40,14 @@ def prepare_image(img): return image -async def detect_image(url: str, file_size: int) -> float: +async def detect_image(url: str, max_size: int) -> float: try: req = await request.get(url) except Exception: raise RequestError("Get info from download image failed!") img_byte = getsizeof(req.read()) // 1024 - if img_byte < file_size: + if img_byte < max_size: return 0 try: -- cgit v1.2.3