edgeupdate

This commit is contained in:
2022-12-16 10:42:08 +08:00
parent 2d9e09785d
commit e764c3d917
2 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

@ -43,14 +43,15 @@ def addobs(file_path, status): #save videos
break break
if not 'data' in status: if not 'data' in status:
os.remove(file_path) os.remove(file_path)
return None return 'can not get the status'
status = status['data'] status = status['data']
objectkey = os.path.basename(file_path) objectkey = os.path.basename(file_path)
backups_path = os.sep.join([cfg.backups, status+'_'+objectkey]) backups_path = os.sep.join([cfg.backups, status+'_'+objectkey])
time = os.path.basename(file_path).split('-')[0] time = os.path.basename(file_path).split('-')[0]
if objectkey.split('.')[-1] in ['avi','mp4']: if objectkey.split('.')[-1] in ['avi','mp4']:
objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey objectkey = 'videos/'+time+'/'+status+'/'+status+'_'+objectkey
resp = obsClient.putFile(bucketName, objectkey, file_path) if status == '02':
resp = obsClient.putFile(bucketName, objectkey, file_path)
shutil.move(file_path, backups_path) shutil.move(file_path, backups_path)
#os.remove(file_path) #os.remove(file_path)