michabirklbauer / instagram_json_viewer

Transforms Instagram's *.json / backup data - that you get via the Data Download Tool - to a readable format!
https://michabirklbauer.github.io/instagram_json_viewer/
MIT License
51 stars 13 forks source link

KeyError: 'Username\x9d¤' #16

Closed Benji005 closed 3 years ago

Benji005 commented 3 years ago

Traceback (most recent call last): File "F:\instaview.py", line 1039, in read_messages html_chat_string = html_chat_string + "\t<img src=\"" + str(avatars[message["sender_name"]]) + "\" alt=\"" + str(message["sender_name"]).upper() + "\" class=\"right\" style=\"width:100%;\">\n"

KeyError: 'Username\x9d¤'

The above error keeps throwing up for all the id's in my chat and hence the message.json is not getting converted.

michabirklbauer commented 3 years ago

Is this 'Username\x9d¤' your username? I don't exactly know what the problem is but I would suspect that is has something to do with the encoding and that python doesn't like the special character in there. Hard to say without the data unfortunately.

Benji005 commented 3 years ago

Yes the username is My username. Will you able if i provide you with a part of my one the message json files?

michabirklbauer commented 3 years ago

Could you try with this version of the script if that fixes the error for you?

https://raw.githubusercontent.com/t0xic-m/instagram_json_viewer/bugfix_un-encoding/instaview.py

Benji005 commented 3 years ago

Yeah.. It worked. Thanks a lot!