instagrapi
instagrapi copied to clipboard
[BUG] Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/nike/?__a=1&__d=dis) >>>
Curious if anyone else is receiving this message when making public requests, as it only begun occurring recently for me.
I've tested to make sure it wasn't an issue with my code by returning to an older version of my code and the issue persisted, so I'd like to know if this has started happening recently to anyone else.
Calling:
result = cl.user_info_by_username("nike").dict()
Returns:
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/nike/?__a=1&__d=dis) >>>
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/nike/?__a=1&__d=dis) >>>
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/nike/?__a=1&__d=dis) >>>
It does return the user info after calling so it really isn't any issue. I'd like to know if anyone could provide any insight? Thanks
I also have this problem
Yeah I get this as well.
Same here. As I understand it something changed in the JSON returned by instagram pages, so the instagrapi function that uses them, has to be changed too. I think (and hope) this will be done shortly with next instagrapi update.
That's weird that it doesn't send a 404 message back to the client. Because Instagram has patched this a few weeks ago but somehow this one got reverted but without data. That's interesting.
Like to note for anyone with this issue, that as a result of this I swapped to making a private request instead for fetching user info:
user_info_dict = cl.user_info_by_username_v1(username).dict()
Problem for me is that with the _v1
method, I get a 429
error every time. Not sure exactly, why (I think, I already tried waiting some time and this happens on the first request, already). But that's what happens for me. So at the moment, this is not usable for me.
same
same
solved , check here https://github.com/subzeroid/instagrapi/pull/1868
Problem for me is that with the
_v1
method, I get a429
error every time. Not sure exactly, why (I think, I already tried waiting some time and this happens on the first request, already). But that's what happens for me. So at the moment, this is not usable for me.
Weird, I haven't gotten that, is that still an issue? Do you think it could be related with login process ( setting headers / session info / etc)? Is that 429
prompted similar to the Status 201: JSONDecodeError
just into the console without the instagrapi logger ? I'll try and look into it.
Also, subzeroid gave the same solution for this issue https://github.com/subzeroid/instagrapi/pull/1844#issuecomment-2018947707
@tajbowness I get the error in the console, not sure, if it's also logged.
This might not be a problem of instagrapi. Not sure. Possibly, it is just that my account on Instagram is blocked, so only public requests work. But not sure, usually, also private requests should work, until it's throttled.
@tajbowness I get the error in the console, not sure, if it's also logged.
This might not be a problem of instagrapi. Not sure. Possibly, it is just that my account on Instagram is blocked, so only public requests work. But not sure, usually, also private requests should work, until it's throttled.
@claell Have you tried this on another account to see if its not an issue with your account? If they happen on other accounts then perhaps its an issue with the login details? I've seen issues caused with using certain user agents. I've used just the default one and I believe it hasn't caused any issues. Same with the default device_settings
.
"Instagram 318.0.0.30.110 Android (34/14.0.0; 480dpi; 1080x1920; OnePlus; 6T Dev; devitron; qcom; en_US; 314665256)"
Also have you tried doing it with a new sessionid
I think it's not about your user, as I got that everytime when i do user_info on any user - get 3 information like:
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/an_na.xx/?__a=1&__d=dis) >>>
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/an_na.xx/?__a=1&__d=dis) >>>
Status 201: JSONDecodeError in public_request (url=https://www.instagram.com/an_na.xx/?__a=1&__d=dis) >>>
It means you create something as response. So pretty much it's pretty useless. I suggest using graphql endpoints instead to retrieve data.
I also have the same problem
https://github.com/subzeroid/instagrapi/pull/1868
Fix for user info gql
I didnt now ho to solve it what i need to add ?