finish add thumbnail to video,image,pdf files (#18)

This commit is contained in:
KevinHuSh
2023-12-27 17:49:09 +08:00
committed by GitHub
parent 3fc700a1d4
commit cdd956568d
5 changed files with 145 additions and 12 deletions

View File

@ -54,11 +54,24 @@ class HuMinio(object):
r = self.conn.get_object(bucket, fnm)
return r.read()
except Exception as e:
logging.error(f"Fail get {bucket}/{fnm}: "+str(e))
logging.error(f"fail get {bucket}/{fnm}: "+str(e))
self.__open__()
time.sleep(1)
return
def get_presigned_url(self, bucket, fnm, expires):
for _ in range(10):
try:
return self.conn.get_presigned_url("GET", bucket, fnm, expires)
except Exception as e:
logging.error(f"fail get {bucket}/{fnm}: "+str(e))
self.__open__()
time.sleep(1)
return
if __name__ == "__main__":
conn = HuMinio("infiniflow")
fnm = "/opt/home/kevinhu/docgpt/upload/13/11-408.jpg"