From bdad3aca1e7ddece4220617d157c59edac902441 Mon Sep 17 00:00:00 2001 From: Luke Ogburn <21106956+logburn@users.noreply.github.com> Date: Thu, 4 Mar 2021 20:20:33 -0500 Subject: [PATCH] updating --- cronjob.py | 4 ++-- interval | 1 + transfer.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 interval diff --git a/cronjob.py b/cronjob.py index 2f95635..b99a54b 100644 --- a/cronjob.py +++ b/cronjob.py @@ -17,7 +17,7 @@ from base64 import b64decode, b64encode # global vars location = "/home/pi/final/videos/" # location of video files, subfolders "plaintext" and "encrypted" assumed to exist -seconds = 3 # seconds to record video for +seconds = int(open("interval", "r").read()) # seconds to record video for # helps with video recording def handler(s, f): @@ -61,7 +61,7 @@ def encryptVideo(file): with open(location+"encrypted/" + numFiles() + ".mpc", "wb") as encf: encf.write(enc) # save the key - with open("keys/" + numFiles() + ".asc", "wb") as keyf: + with open("keys/" + str(int(numFiles()) - 1) + ".asc", "wb") as keyf: keyf.write(encryptPGP(key)) # record the video and store in file location diff --git a/interval b/interval new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/interval @@ -0,0 +1 @@ +3 diff --git a/transfer.py b/transfer.py index d3038ed..a05e2ce 100644 --- a/transfer.py +++ b/transfer.py @@ -20,8 +20,8 @@ host = '10.25.10.18' # IP of server that will recieve, not this device port = 12352 location = "/home/pi/final/" -vidset = [file for file in glob.glob(location + "videos/encrypted/*", recursive=False)] -keyset = [file for file in glob.glob(location + "keys/*", recursive=False)] +vidset = [file for file in glob.glob(location + "videos/encrypted/*.mpc", recursive=False)] +keyset = [file for file in glob.glob(location + "keys/*.asc", recursive=False)] if len(vidset) != len(keyset): print("Video and keyfiles are not properly matched") exit()