From fb5a1c3e1f2a6c0b9661b61982591377fefb04fc Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Sat, 7 Sep 2024 18:30:38 +0800 Subject: [PATCH] Bug fix on incomplete JSON output on --per-chat #86 --- Whatsapp_Chat_Exporter/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/__main__.py b/Whatsapp_Chat_Exporter/__main__.py index 3b3eed8..2f48a8c 100644 --- a/Whatsapp_Chat_Exporter/__main__.py +++ b/Whatsapp_Chat_Exporter/__main__.py @@ -579,7 +579,7 @@ def main(): else: contact = jik.replace('+', '') with open(f"{args.json}/{contact}.json", "w") as f: - file_content_to_write = json.dumps(data[jik], ensure_ascii=not args.avoid_encoding_json, indent=2 if args.pretty_print_json else None) + file_content_to_write = json.dumps({jik: data[jik]}, ensure_ascii=not args.avoid_encoding_json, indent=2 if args.pretty_print_json else None) f.write(file_content_to_write) print(f"Writing JSON file...({index + 1}/{total})", end="\r") print()