mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-04-28 08:44:59 +00:00
Prevent PermissionError from raising
This commit is contained in:
@@ -150,7 +150,10 @@ def main():
|
|||||||
create_html(data, options.output, options.template)
|
create_html(data, options.output, options.template)
|
||||||
|
|
||||||
if not os.path.isdir(f"{options.output}/{options.media}"):
|
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:
|
if options.json:
|
||||||
with open("result.json", "w") as f:
|
with open("result.json", "w") as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user