TelegramTools / TLImporter

📲 Telegram Chat Importer: Import chats from WhatsApp or other services into Telegram
GNU Affero General Public License v3.0
127 stars 11 forks source link

Adapting for other data formats #9

Closed mowolf closed 4 years ago

mowolf commented 4 years ago

I don't know if you are aware, but currently your program only supports two data formats of the exported data from WhatsApp. The exported data format unfortunately depends on the device settings (Country, Clock etc.).

At some point in time I needed to cover all these cases and built a quite complex regex that covers all different formats which I encountered so far.

You can have a look at the regex here: https://www.debuggex.com/r/VGwUUxtq7tvF2rJB

I would recommend to replace this construct with a regex parser.

To get TLImporter working for me I adapted it to also accept this format: [27.03.14, 18:28:35] NAME: TXT

You can see my pull request here. https://github.com/TelegramTools/TLImporter/pull/8

ferferga commented 4 years ago

Yes, I was aware, but due to the fact that I wanted TLImporter to be finished, bug-free and working for me as fast as possible, I didn't had a lot of time to check all the possible regex that WhatsApp uses for exported chats (as take in mind that WhatsApp is one of the possibilities, there are thousands of messagging applications out there, and building a regex that could work for all of them correctly, without matching contents inside the message itself instead of the headers is really difficult. So there is no correct way to please everybody who might use this!)

Your changes are now merged. I already left you a comment in #8, but I will say it again here, thank you very much for adding to my script what I left behind.

Have a really nice day and the best possible of the beginnings for the new year!