edgeupdate
This commit is contained in:
Binary file not shown.
@ -43,14 +43,15 @@ def addobs(file_path, status): #save videos
|
||||
break
|
||||
if not 'data' in status:
|
||||
os.remove(file_path)
|
||||
return None
|
||||
return 'can not get the status'
|
||||
status = status['data']
|
||||
objectkey = os.path.basename(file_path)
|
||||
backups_path = os.sep.join([cfg.backups, status+'_'+objectkey])
|
||||
time = os.path.basename(file_path).split('-')[0]
|
||||
if objectkey.split('.')[-1] in ['avi','mp4']:
|
||||
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)
|
||||
#os.remove(file_path)
|
||||
|
||||
|
Reference in New Issue
Block a user