Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.zip import only draws chat, not attachments #86

Open
jonathanold opened this issue Jul 13, 2022 · 3 comments
Open

.zip import only draws chat, not attachments #86

jonathanold opened this issue Jul 13, 2022 · 3 comments
Labels

Comments

@jonathanold
Copy link

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?

@uptoratlen
Copy link
Contributor

uptoratlen commented Jul 13, 2022

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.

@uptoratlen
Copy link
Contributor

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.....

@prabhakar267
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants