feat: make dir if it doesn't exist

This commit is contained in:
Mark Bailey 2024-11-04 15:29:56 -05:00
parent 0af50c21ae
commit 2b09371cbf

View File

@ -43,6 +43,9 @@ def post_detect(file: Image, strength: DetectionStrength):
print("\nWorking on: " + file_name)
print("\nStrength: " + strength + "\n")
if not os.path.exists("data/"):
os.makedirs("data")
with open("data/" + file_name, "wb") as f:
f.write(b64decode(file.file_contents))