Chatistics icon indicating copy to clipboard operation
Chatistics copied to clipboard

[Hangouts] KeyError: 'conversations'

Open endersaka opened this issue 5 years ago • 2 comments

Hi,

I tried:

$ python parse.py hangouts -f path/to/my/hangouts.json
2020-07-29 04:48:07,372 [INFO ] [parsers.hang]: Parsing Google Hangouts data...
2020-07-29 04:48:07,372 [INFO ] [parsers.hang]: Reading archive file path/to/my/hangouts.json...
2020-07-29 04:48:09,348 [INFO ] [parsers.hang]: Trying to infer own_name from data...
Traceback (most recent call last):
  File "parse.py", line 84, in <module>
    ArgParse()
  File "parse.py", line 42, in __init__
    getattr(self, args.command)()
  File "parse.py", line 60, in hangouts
    main(args.own_name, args.file_path, args.max)
  File "/path/to/Chatistics/parsers/hangouts.py", line 21, in main
    own_name = infer_own_name(archive)
  File "/path/to/Chatistics/parsers/hangouts.py", line 167, in infer_own_name
    for conversation in archive['conversations']:
KeyError: 'conversations'

Then, I tried:

$ python parse.py hangouts --own-name MARCO -f path/to/my/hangouts.json
2020-07-29 04:49:05,521 [INFO ] [parsers.hang]: Parsing Google Hangouts data...
2020-07-29 04:49:05,521 [INFO ] [parsers.hang]: Reading archive file path/to/my/hangouts.json...
2020-07-29 04:49:07,308 [INFO ] [parsers.hang]: Extracting messages...
Traceback (most recent call last):
  File "parse.py", line 84, in <module>
    ArgParse()
  File "parse.py", line 42, in __init__
    getattr(self, args.command)()
  File "parse.py", line 60, in hangouts
    main(args.own_name, args.file_path, args.max)
  File "/path/to/Chatistics/parsers/hangouts.py", line 22, in main
    data = parse_messages(archive, own_name)
  File "/path/to/Chatistics/parsers/hangouts.py", line 102, in parse_messages
    for conversation in archive['conversations']:
KeyError: 'conversations'

Then I tried to copy the file in ./raw_data/hangouts/, call python parse.py hangouts --own-name MARCO and got the same error.

endersaka avatar Jul 29 '20 03:07 endersaka

Little update. I found out that the JSON I have has a different format than that described in the comment of function parse_messages(), in file ./parsers/hangout.py, line 36.

Therefore I am downloading my Hangouts backup from Google Takeout, once again, to see if anything has changed.

endersaka avatar Jul 29 '20 05:07 endersaka

Resolved, Google has changed the JSON spec. Chatistics does not support old format, it seems.

endersaka avatar Jul 29 '20 06:07 endersaka