3bl3gamer / tg_history_dumper

Exports messages and media from Telegram dialogs, groups and channels
MIT License
69 stars 13 forks source link

Contacts + Sessions + Account Info Dump #7

Closed patrizok closed 3 years ago

patrizok commented 3 years ago

Hi, Thank you for your detailed suggestions.

• I update .gitignore file to prevent updating config and dump files. • I resolve the coding problems that you point. • I do not support updating session and contact right now. Because Telegram already return all data in one response. It can be disabled by config.json or command line parameters. UpdatedAt is not required also. • Config.json supports enable and disable new features. • Command line parameter enable disable works. • Not update account, session and contacs when --list-chats flag enabled. • English document updated, but .zh document is not updated. You can update it later if you want.

Since account/contacts/auths are saved as-is (exactly in format they come from TG), they should a) have "_" field with type and b) have "_TL_LAYER" field with API version (like messages: README, code example).

• This is the only thing that I not implement. I don't know why users need the type and layer version. Adding these information to dump files also increase code complexity, chats and users file also does not have this information.

I am not Russian by the way.

patrizok commented 3 years ago

Hello,

As you mentioned changes applied.

Also mtproto library has some problems on Windows

Can you please check it. In this project I get error;

[ERROR] failed to connect: rename tg.session.temp tg.session: The process cannot access the file because it is being used by another process.

Thanks

3bl3gamer commented 3 years ago

rename tg.session.temp tg.session: The process cannot access

Fixed this one. You can check it by updating github.com/3bl3gamer/tgclient dependency to v0.126.1

patrizok commented 3 years ago

I update depencencies

With new version of github.com/3bl3gamer/tgclient file IO problem fixed but there is an another problem with Windows. I can not understand problem with errorcode.

[ERROR] : unexpected response: mtproto.TL_bad_msg_notification{BadMsgID:6982098918416156760, BadMsgSeqno:7, ErrorCode:33}

main.tgConnect /home/kali/Desktop/tg-history-dumper/tg.go:101 main.dump /home/kali/Desktop/tg-history-dumper/main.go:242 main.main /home/kali/Desktop/tg-history-dumper/main.go:333 runtime.main /usr/lib/go-1.15/src/runtime/proc.go:204 runtime.goexit /usr/lib/go-1.15/src/runtime/asm_amd64.s:1374

_Id dump comes with the TL_contactscontacts.Users -> Contacts array seems not required because even if I do not start chat contact already comes in Users array. (contact has empty message history, etc) hypotheses not work here. Users and Contacts already mingling with each other adding SaveRelatedUsers file will be puzzle if not really required.

There are just IDs with separate TL_contacts_contacts.Users array. It should also be saved via SaveRelatedUsers (in case a contact has empty message history, etc).


Comment #7 ( "_TLLAYER" and "" ) done right now. I am not good at dependency management with go, so can you please check the mod and sum files.

patrizok commented 3 years ago

1 - Actually there is no reason to reverse contacts, it doesn't matter, but I changed it to avoid misunderstanding. 2 - I run your code and I checked TL version downgraded to 126 in dump files. 3 - Let's leave it as it is for easy processing (TL_contacts_contacts.Users). If someone need b options, then it can be changed.

3bl3gamer commented 3 years ago

Cool! Thank you again, will merge it now.

I will also merge some changes soon which will fix log colors on Windows. If it won't work, fell free to open another issue!