支持截图,文件存储改用minio

This commit is contained in:
SwZ
2025-04-01 14:43:02 +08:00
parent c5cdf350ab
commit bde05bc884
4 changed files with 67 additions and 18 deletions

16
miniofile.py Normal file
View File

@@ -0,0 +1,16 @@
from const import ENDPOINT, ACCESS_KEY, SECRET_KEY, BUCKET
from minio import Minio
client = Minio(
endpoint=ENDPOINT,
access_key=ACCESS_KEY,
secret_key=SECRET_KEY,
secure=False
)
def put_object(name, content):
length = len(content.getbuffer())
content.seek(0)
client.put_object(BUCKET, name, content, length)