Originally created by: amolinae06
Describe the bug
When attempting to open instagram-cli I get the error mentioned below. I'm using an executable made by myself.
To Reproduce
Steps to reproduce the behavior:
instagram-cli chat start.Get the following error:
Attempting to login with session...
╭──────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────╮
│ in start:77 │
│ │
│ in start_chat:47 │
│ │
│ in wrapper:94 │
│ │
│ in init_chat:45 │
│ │
│ in main_loop:62 │
│ │
│ in with_loading_screen:33 │
│ │
│ in fetch_chat_data:54 │
│ │
│ in direct_threads:88 │
│ │
│ in direct_threads_chunk:153 │
│ │
│ in extract_direct_thread:288 │
│ │
│ in extract_user_short:195 │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'NoneType' object has no attribute 'get'
[PYI-31784:ERROR] Failed to execute script 'cli' due to unhandled exception!
Expected behavior
Chats should open normally.
Screenshots
Desktop (please complete the following information):
Originally posted by: supreme-gg-gg
This seems to be an issue with instagrapi and how it handles Instagram API responses. It’s likely that a specific chat has missing fields in the response, which can happen since Instagram doesn’t have an official API. We’ll look into adding a wrapper to prevent these errors from breaking chat functionality, but it seems to be a very rare case.
If you try searching and opening a specific chat (e.g. by username) and it works properly, it is probably a rare issue with loading message from one specific chat in the list.
Ticket changed by: supreme-gg-gg