Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login throws at _find_no_duplicates #2242

Open
tulssinep opened this issue May 5, 2024 · 1 comment
Open

Login throws at _find_no_duplicates #2242

tulssinep opened this issue May 5, 2024 · 1 comment
Labels
bug Bug

Comments

@tulssinep
Copy link

tulssinep commented May 5, 2024

Describe the bug
Regardless of whether I try to use instaloader via command line or via python package in code, I can't log in.

Doing it via command line, I get "Login error: Wrong password." (and one time I saw a longer error message about the same thing that looks like it comes from IG). Doing it via code, it throws immediately as shown in the stack trace below

Error messages and tracebacks
If applicable, add error messages and tracebacks to help explain your problem.

python3 main.py 
Traceback (most recent call last):
  File "/Users/pp/instacopy/main.py", line 7, in <module>
    L.login("abc", "12")        # (login)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/instaloader/instaloader.py", line 651, in login
    self.context.login(user, passwd)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/instaloader/instaloadercontext.py", line 318, in login
    session.headers.update({'X-CSRFToken': login.cookies['csrftoken']})
                                           ~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/cookies.py", line 334, in __getitem__
    return self._find_no_duplicates(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/cookies.py", line 413, in _find_no_duplicates
    raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
KeyError: "name='csrftoken', domain=None, path=None"

Instaloader version
4.11

I tried with 2 different accounts.

@tulssinep tulssinep added the bug Bug label May 5, 2024
@tulssinep
Copy link
Author

I may add that resp_json looks like everything should be ok: {'user': True, 'userId': '123', 'authenticated': True, 'oneTapPrompt': True, 'reactivated': True, 'status': 'ok'}

Here is the log output from running it directly in the git repository:

$ python3 instaloader.py --login=ab profile abc
Session file does not exist yet - Logging in.
Enter Instagram password for ab: 
{'user': True, 'userId': '123', 'authenticated': True, 'oneTapPrompt': True, 'reactivated': True, 'status': 'ok'}
Traceback (most recent call last):
  File "/Users/pp/instaloader/instaloader.py", line 6, in <module>
    main()
  File "/Users/pp/instaloader/instaloader/__main__.py", line 541, in main
    _main(loader,
  File "/Users/pp/instaloader/instaloader/__main__.py", line 184, in _main
    instaloader.interactive_login(username)
  File "/Users/pp/instaloader/instaloader/instaloader.py", line 1595, in interactive_login
    self.login(username, password)
  File "/Users/pp/instaloader/instaloader/instaloader.py", line 651, in login
    self.context.login(user, passwd)
  File "/Users/pp/instaloader/instaloader/instaloadercontext.py", line 320, in login
    session.headers.update({'X-CSRFToken': login.cookies['csrftoken']})
                                           ~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/cookies.py", line 334, in __getitem__
    return self._find_no_duplicates(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/requests/cookies.py", line 413, in _find_no_duplicates
    raise KeyError(f"name={name!r}, domain={domain!r}, path={path!r}")
KeyError: "name='csrftoken', domain=None, path=None"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

No branches or pull requests

1 participant