I have been working at writing simple code to upload the newest video in a folder to Dropbox with python. I almost got it working but am running into two issues. The big issue is while the video shows up on Dropbox it cannot be played and I believe the file is corrupted when uploaded. The other issue is that the filename is renamed which I would like to keep the filename because I added a timestamp to the name to easily record when the video was taken. -Thanks
dbx.dropbox.Dropbox('EmptyKey')
allfiles = glob.glob('/home/pi/Documents/CameraFeeds/*.h264')
newestfile = max(allfiles, key=os.path.getctime)
dropbox_path = os.path.join('/*')
with open(newestfile, 'rb') as f:
dbx.files_upload(f.read(), dropbox_path, mute=True)