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] When reusing session I get unauthorized & Wait for some minutes #1689

Open PonyOny opened 9 months ago

PonyOny commented 9 months ago

Describe the bug If I freshly create a new session & Instagram sends me a notification of new device activity etc.. it works properly, but after a while it says i have to login again, when done it reuses the created session but then it will not work, I get the 401 unauthorized and in order to work again I have to delete the session & create a new one, this was working for me before, since more or less a weak this started to happen.

Expected behavior Reusing Session should work as before, being able to like/comment posts after a period of time.

Desktop (please complete the following information):

rodgersxy commented 8 months ago

General idea: manage the sessions,for example having two methods, one to load account details, loaded information that is then used to set up the account. Two, method responsible for login process, It checks whether a session file exists for the specified account, save the session in JSON that will be reused or create new one it doesn't exist

  1. consider writing code that refresh expired sessions