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

Parse talker name error #39

Closed
ViktorSE opened this issue Mar 1, 2017 · 9 comments
Closed

Parse talker name error #39

ViktorSE opened this issue Mar 1, 2017 · 9 comments

Comments

@ViktorSE
Copy link

ViktorSE commented Mar 1, 2017

It seems to be something is in the way for parse the talker:

./dump-msg.py decrypted.db OutDir/
[18:36:32 80@parser.py:wechat.parser] Your username is: wxid_xxxxxxxxxxxxxx
[18:36:32 54@parser.py:wechat.parser] Found XX contacts.
[18:36:32 43@msg.py:wechat.msg] Unhandled message type: xxxxxxx
[18:36:32 43@msg.py:wechat.msg] Unhandled message type: xxxx
Traceback (most recent call last):
File "./dump-msg.py", line 23, in
parser = WeChatDBParser(db_file)
File "/home/myuser/Downloads/WechatBackup/wechat/parser.py", line 39, in init
self._parse()
File "/home/myuser/Downloads/WechatBackup/wechat/parser.py", line 120, in _parse
self._parse_msg()
File "/home/myuser/Downloads/WechatBackup/wechat/parser.py", line 63, in _parse_msg
values = self._parse_msg_row(row)
File "/home/myuser/Downloads/WechatBackup/wechat/parser.py", line 151, in _parse_msg_row
logger.warn("Unknown contact, probably deleted: {}".format(tk_id))
UnboundLocalError: local variable 'tk_id' referenced before assignment

Why reading the database(decrypted.db), it seems to be OK(table 'message' converts to csv output):

index,msgId,msgSvrId,type,status,isSend,isShowTimer,createTime,talker,content,imgPath,reserved,lvbuffer,transContent,transBrandWording,talkerId,bizClientMsgId,bizChatId,bizChatUserId,msgSeq,flag
0,2,3.32903169404e+18,1,3.0,0.0,,1438259445000,weixin,歡迎你再次回到WeChat。如果你在使用過程中有任何的問題或建議,記得告訴我哦。,,,{,,,22,,,,,0
...

Any clue for finding the bug?

@ppwwyyxx
Copy link
Owner

ppwwyyxx commented Mar 1, 2017

You seem to be using an old version of this project. Could you update and try again?

@ViktorSE
Copy link
Author

ViktorSE commented Mar 1, 2017 via email

@ppwwyyxx
Copy link
Owner

ppwwyyxx commented Mar 2, 2017

  1. I'll see if I can ignore the error.

  2. I don't know what you mean. It lists one column of "display name" and one column of internal id, and what do you want?

  3. (1) sqlite, sqlcipher and sox are not required. I'll add the rest.
    (2) I've never used that app. I think how people should root the device and configure adb is different for every model of phone. But I'll add a note. // Oh it looks like there is already a note in the README

@ppwwyyxx
Copy link
Owner

ppwwyyxx commented Mar 2, 2017

I might have fixed the avatar issue.

@ViktorSE
Copy link
Author

ViktorSE commented Mar 2, 2017 via email

@ppwwyyxx
Copy link
Owner

ppwwyyxx commented Mar 2, 2017

  1. I see, could you just modify the last line in list-chats.py? The code is made very simple so people can dump information in a different format they may need.

@ViktorSE
Copy link
Author

ViktorSE commented Mar 2, 2017

With updated version, I can dump messages to html-files. Cheers!

However, the list chats seems to have encoding problem?

./list-chats.py decrypted.db
[14:26:48 82@parser.py:wechat.parser] Your username is: wxid_abcde123456789
[14:26:48 56@parser.py:wechat.parser] Found xx names in contact table.
[14:26:48 44@msg.py:wechat.msg] Unhandled message type: 10002
[14:26:48 159@parser.py:wechat.parser] Unknown contact: 123456789@chatroom
...
[14:26:48 159@parser.py:wechat.parser] Unknown contact: 123456789@chatroom
[14:26:48 44@msg.py:wechat.msg] Unhandled message type: 318767153
[14:26:49 44@msg.py:wechat.msg] Unhandled message type: 268435505
[14:26:49 76@parser.py:wechat.parser] Found 22491 message records.
[14:26:49 88@parser.py:wechat.parser] Found 1158 hd image records.
123456789@chatroom Traceback (most recent call last):
File "./list-chats.py", line 17, in
print k.encode('utf-8'), '\t', parser.contacts_rev[k].encode('utf-8')
AttributeError: 'list' object has no attribute 'encode'

I am not program developer so I DO just as it shown in README:-) When it fails I try googling the error message(s).

@ppwwyyxx
Copy link
Owner

ppwwyyxx commented Mar 2, 2017

No you haven't updated everything to the latest version. The script list-chats.py is changed.

@ViktorSE
Copy link
Author

ViktorSE commented Mar 2, 2017

OK, I fresh them to newest version and it works. Sorry for my mistake!

@ViktorSE ViktorSE closed this as completed Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants