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

Something went wrong in Telegram's side #4

Closed Skalyx14 closed 4 years ago

Skalyx14 commented 5 years ago

Hello, Thanks for the tool. Here is the problem I have:

INFORMATION: Each 2000 messages, a pause of around 7 minutes will be done for reducing Telegram's flood limits. Be patient, the process will be still going on.

N/A% (0 of 8600) | | Elapsed Time: 0:00:00 ETA: --:--:-- Something went wrong in Telegram's side. This is the full exception:

Cannot cast NoneType to any kind of InputPeer. Press ENTER to try again:

Something went wrong in Telegram's side. This is the full exception:

Cannot cast NoneType to any kind of InputPeer.

It seems that you have already reached some problems before. You can keep retrying again, or exit TLImporter and report this error in https://github.com/TelegramTools/TLImporter/issues.

Please refer to the log. I noticed a similar issue was already opened but is closed now. TLImporter-log.log

ferferga commented 5 years ago

See from here to the bottom of the issue. It seems that WhatsApp has changed the format of their exported chats. You can fix it on your own or wait until I fix it, although I'm quite busy lately (I won't probably have some spare time until summer).

Let me know how it goes, please :)

Skalyx14 commented 5 years ago

Hello, Thanks for the answer. Yes I understand how it works. I have Whatsapp in French so the format is different. For ex: 28.04.19 à 14:13 - Anonymous: Test So I must find a way to modify the format to: 15/02/2018 16:52:04: Test It seems quite difficult for me haha. I can remove the "à" but would be difficult to find something to convert the date from xx.xx.xx to yy/yy/yyyy in .txt. Do you have any idea?

ferferga commented 5 years ago

You can use regex, although this can be a bit complex if you have no idea. Sincerely I'm stuck on how I can do this universally, as now it seems that every lang uses an specific format :(

I've asked the guy who originally discovered this at #2 , so keep an eye to the thread in case Salvatore replies :)

Skalyx14 commented 5 years ago

Thanks! Sure.

rhyswilliamsza commented 5 years ago

@ferferga

Regex to correct WhatsApp:

'(\d\d\d\d)/(\d\d)/(\d\d), (\d\d:\d\d) - '
=>
'$3/$2/$1 $4:00: '

I also had to do a replacement on all multiline messages.

ferferga commented 5 years ago

'(\d\d\d\d)/(\d\d)/(\d\d), (\d\d:\d\d) - '

Which replacement exactly?

Testing your regex to publish a new version with the fixes.

ferferga commented 5 years ago

@Skalyx14 You were able to finally import the chat without further issues, right?

ferferga commented 4 years ago

All this problems should have been fixed in 3.0.3 release.