list-chats.py 399 B

1234567891011121314151617
  1. #!/usr/bin/env python3
  2. # -*- coding: UTF-8 -*-
  3. # File: list-chats.py
  4. # Author: Yuxin Wu <ppwwyyxx@gmail.com>
  5. from wechat.parser import WeChatDBParser
  6. import sys
  7. if len(sys.argv) != 2:
  8. print("Usage: {} db_file".format(sys.argv[0]))
  9. sys.exit(1)
  10. db_file = sys.argv[1]
  11. parser = WeChatDBParser(db_file)
  12. chats = parser.msgs_by_chat.keys()
  13. for k in chats:
  14. print(parser.contacts[k], '\t', k)