prabhakar267/WA-Reader

.zip import only draws chat, not attachments

Opened this issue · 3 comments

I have tried to run the WA-Reader locally with .zip files. While the chat loads, attachments are not loaded. My hypothesis is that this is because the attachment format has changed. In the sample .zip file, messages with attachments follow the format:
28.05.21, 21:45 - MasterMind: ‎VID-20210528-WA0002.mp4 (Datei angehängt)
In my exported WhatsApp chats, the format is:
‎[9/24/21, 17:53:31] Name: ‎<attached: name-of-attachment.jpg>

Any fix for this?

Try to change the file: constants.py
there is a section we offered on our best knowledge:
ATTACHMENT_MESSAGES = [
"Media attached",
"Datei angehängt",
]

English and German.
I guess this might work

ATTACHMENT_MESSAGES = [
"Media attached",
"Datei angehängt",
"<attached:",
]
But this is just a guess based on a quick look.

Just found it will not work (fully) . I got a workaround aka but there is a limitation.
open the file: utils.py and goto function get_media_path (or line 39)
change this line:
tmp_filepath = os.path.join("./static/chat", text_segment.strip().replace("\u200e", ""))

to:
tmp_filepath = os.path.join("./static/chat", text_segment.strip().replace("\u200e", "").replace(">",""))

Save and restart local flask server.
The limitation is that in case you got a chat line with a media and something like
28.05.21, 22:22 - Minion: ‎<attached: IMG-20210528-WA0007.jpg> a>b
the ">" between "a>b" will be removed.

But as a small fix it will help you. Pls report back if so.....

@jonathanold Can you upload a small sample file to someone to take a look at it?