Duplicated folder creation
https://github.com/KnugiHK/Whatsapp-Chat-Exporter/issues/14
This commit is contained in:
KnugiHK
2022-05-25 18:28:07 +08:00
parent 042f6f9024
commit 996ee65525

View File

@@ -115,7 +115,10 @@ def extract_media(base_dir):
folder = hashes[:2]
flags = row[2]
if flags == 2:
os.mkdir(destination)
try:
os.mkdir(destination)
except FileExistsError:
pass
elif flags == 1:
shutil.copyfile(f"{base_dir}/{folder}/{hashes}", destination)
i += 1