masterUpdate
This commit is contained in:
@ -52,6 +52,27 @@ def addobs(file_path, status): #save videos
|
||||
resp = obsClient.putFile(bucketName, objectkey, file_path)
|
||||
#os.remove(file_path)
|
||||
|
||||
def updateAgain():
|
||||
try:
|
||||
for name in os.listdir(cfg.VIDEOPATH):
|
||||
file_path = os.sep.join([cfg.VIDEOPATH, name])
|
||||
videoUuid = os.path.basename(file_path).split('_')[1]
|
||||
json_data = {'videoUuid': videoUuid}
|
||||
resp = requests.post(url=cfg.Vre,
|
||||
data=json_data)
|
||||
status = resp.json()
|
||||
status = status['data']
|
||||
|
||||
objectkey = os.path.basename(file_path)
|
||||
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)
|
||||
os.remove(file_path)
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
|
||||
def Addimg(uuid_barcode):
|
||||
time = uuid_barcode.split('-')[0].split('_')[-1]
|
||||
objectkey = 'imgs/'+time+'/'+uuid_barcode+'.jpg'
|
||||
|
Reference in New Issue
Block a user