subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.21k stars 667 forks source link

[BUG] login gets stuck at "https://i.instagram.com/api/v1/challenge/" or "Enter password for" level #2020

Closed Altimis closed 1 week ago

Altimis commented 1 week ago

I noticed lately that cl.login always gets stuck at "https://i.instagram.com/api/v1/challenge/" or at "Enter password for heroic.forest.art.al2181" level:

2024-09-12 20:48:13,581:https://i.instagram.com/api/v1/launcher/sync/
2024-09-12 20:48:13,862:heroic.forest.art.al2181 [200] POST https://i.instagram.com/api/v1/launcher/sync/ (269.0.0.18.75, Samsung Galaxy S10)
2024-09-12 20:48:28,456:https://i.instagram.com/api/v1/accounts/login/
2024-09-12 20:48:31,141:heroic.forest.art.al2181 [200] POST https://i.instagram.com/api/v1/accounts/login/ (269.0.0.18.75, Samsung Galaxy S10)
2024-09-12 20:49:13,217:https://i.instagram.com/api/v1/feed/reels_tray/
2024-09-12 20:49:13,331:heroic.forest.art.al2181 [400] POST https://i.instagram.com/api/v1/feed/reels_tray/ (269.0.0.18.75, Samsung Galaxy S10)
2024-09-12 20:49:43,356:https://i.instagram.com/api/v1/challenge/
2024-09-12 20:49:43,687:heroic.forest.art.al2181 [200] GET https://i.instagram.com/api/v1/challenge/ (269.0.0.18.75, Samsung Galaxy S10)
Enter password for "heroic.forest.art.al2181

I'm not sure if it's duo to Enter password for or the challenge GET request. it's the first time that I started getting this "Enter password for" it's like an infinite loop, or the Input function waits for the password to be entered. Anyone else encountered the same issue please ?

Altimis commented 1 week ago

I found the issue. It's duo to change_password_handler. It needs to be implemented instead of the default one :


def manual_change_password(self, username: str):
    pwd = None
    while not pwd:
        pwd = input(f"Enter password for {username}: ").strip()
    return pwd
Altimis commented 1 week ago

solved