edgeupdate
This commit is contained in:
Binary file not shown.
@ -43,13 +43,14 @@ 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
|
||||||
|
if status == '02':
|
||||||
resp = obsClient.putFile(bucketName, objectkey, file_path)
|
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)
|
||||||
|
Reference in New Issue
Block a user