Skip to content

Commit

Permalink
Another attempt to fix the previous bug
Browse files Browse the repository at this point in the history
  • Loading branch information
KnugiHK committed Apr 8, 2023
1 parent 84383e1 commit 7c0b90d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Whatsapp_Chat_Exporter/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,12 @@ def vcard(db, data):
if not os.path.isdir(base):
Path(base).mkdir(parents=True, exist_ok=True)
for index, row in enumerate(rows):
media_name = row["media_name"]
media_name = row["media_name"] if row["media_name"] is not None else ""
file_name = "".join(x for x in media_name if x.isalnum())
file_path = f"{base}/{file_name}.vcf"
if not os.path.isfile(file_path):
with open(file_path, "w", encoding="utf-8") as f:
f.write(row[2])
f.write(row["vcard"])
data[row["key_remote_jid"]].messages[row["message_row_id"]].data = media_name + \
"The vCard file cannot be displayed here, " \
f"however it should be located at {file_path}"
Expand Down

0 comments on commit 7c0b90d

Please sign in to comment.