Open themrcatsu opened 1 year ago
Yes, interesting, I'll try to reproduce. Thanks!
It looks like 401 status works fine
396 message = last_json.get("message", "")
397 if "Please wait a few minutes" in message:
--> 398 raise PleaseWaitFewMinutes(e, response=e.response, **last_json)
399 if e.response.status_code == 403:
400 if message == "login_required":
PleaseWaitFewMinutes: Please wait a few minutes before you try again.
In [12]: cl.last_json
Out[12]:
{'message': 'Please wait a few minutes before you try again.',
'require_login': True,
'status': 'fail'}
In [13]: cl.last_response.status_code
Out[13]: 401
Im using 1.18.1, and i dont have check like on your code example.
Not sure if this is the same issue but it seems Instagram changed something in their API. I've been trying to use cl.get_followers and cl.get_following although it rate limits me hard. I have time.sleep(random.randint(20, 30))
between each call and i'm not calling the API a lot. And after the API timeout is over, i can't use the saved settings from the last login and i have to re-login.
This is the exception ive been getting during rate limits
instagrapi.exceptions.ClientError: Please wait a few minutes before you try again.
After the rate limit if i try the same settings all cl.get_followers or cl.get_following returns is {}
@themrcatsu try instagrapi 1.18.2
Im facing almost same as @im-kuro, after some calls to api, i got login required, im doing client.relogin(), and got ReloginAttemptExceeded, but im calling directly to hashtag_medias_v1_chunk i got LoginRequired even with public api, just tested, and i tested, this accounts are not banned or something, i can login to account in browser, how to bypass that?
@adw0rd Just checked a bit more, it seems like public requests have something changed
for a1/gql (public API) you can try calling cl.inject_sessionid_to_public()
before
https://adw0rd.github.io/instagrapi/usage-guide/interactions.html
I've updated to v1.18.2 and implemented cl.inject_sessionid_to_public()
before any interaction calls and am still seeing login/API call issues
@adw0rd Now its not stucked, i got 'graphql' KeyError for first time, then i added prints to debug, and seems like i got some response, but now again i have login required
Interesting thing that i got exact LoginRequired instance, which is not raised anywhere in public part of api
Hi.
Seems like instagram made some update, and now PleaseWaitFewMinutes exception catched like ClientError This happends cause of status code is 401 which is not checked inside _send_private_request
Message of response when i get - Please wait a few minutes before you try again. seems to be the same as before