Im trying to get the list of the followers in my instagram account. I see that the program succeeds to log in because every time I run it I receive an email from instagram about a new access to my instagram account but then I get this error. About 2 week ago everything worked fine and i was able to get the list.
This is the error I get:
L.login(username, password) # (login)
File "/opt/homebrew/lib/python3.10/site-packages/instaloader/instaloader.py", line 634, in login
self.context.login(user, passwd)
File "/opt/homebrew/lib/python3.10/site-packages/instaloader/instaloadercontext.py", line 265, in login
session.headers.update({'X-CSRFToken': login.cookies['csrftoken']})
File "/opt/homebrew/lib/python3.10/site-packages/requests/cookies.py", line 335, in __getitem__
return self._find_no_duplicates(name)
File "/opt/homebrew/lib/python3.10/site-packages/requests/cookies.py", line 414, in _find_no_duplicates
raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
KeyError: "name='csrftoken', domain=None, path=None"
It seems like something changed on the Instagram side and this is now a known issue. It can be found on the instaloader issue tracker:
https://github.com/instaloader/instaloader/issues/1758
There seem to be some workarounds listed in the issue. You can try them or wait for the maintainer to accept a patch/update to fix the issue.
In the future, try to check the project's bug tracking system first to see if what you're experience is a known issue. That way, you can work with other developers to work together and test out solutions to the problem.