summaryrefslogtreecommitdiff
path: root/ATRI/plugins/setu/nsfw_checker.py
diff options
context:
space:
mode:
author0w0 <[email protected]>2022-12-29 16:38:27 +0800
committerGitHub <[email protected]>2022-12-29 16:38:27 +0800
commitc0e5f0398bd4c3c55378cff303f31ff968822346 (patch)
treed90bc810150d859c76e64f6e71d8524478014f31 /ATRI/plugins/setu/nsfw_checker.py
parent3d857da2ae1984c6abf286b55888d6d3e4c5d823 (diff)
parentbb13b38f862d859007d1d37941f5b5c9d5f38cbc (diff)
downloadATRI-c0e5f0398bd4c3c55378cff303f31ff968822346.tar.gz
ATRI-c0e5f0398bd4c3c55378cff303f31ff968822346.tar.bz2
ATRI-c0e5f0398bd4c3c55378cff303f31ff968822346.zip
Merge branch 'main' into main
Diffstat (limited to 'ATRI/plugins/setu/nsfw_checker.py')
-rw-r--r--ATRI/plugins/setu/nsfw_checker.py4
1 files changed, 2 insertions, 2 deletions
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: