Prevent PermissionError from raising

This commit is contained in:
KnugiHK
2021-12-28 20:04:40 +08:00
parent abf4b20bc6
commit 9140c07feb

View File

@@ -150,7 +150,10 @@ def main():
create_html(data, options.output, options.template)
if not os.path.isdir(f"{options.output}/{options.media}"):
shutil.move(options.media, f"{options.output}/")
try:
shutil.move(options.media, f"{options.output}/")
except PermissionError:
print(f"Cannot remove original WhatsApp directory. Perhaps the directory is opened?")
if options.json:
with open("result.json", "w") as f: