[BUG] Status 200: JSONDecodeError in public_request

See original GitHub issue

After updating to 1.16.19 I get another error when trying to retrieve the user_id

cl = Client()
cl.load_settings('/home/python/ig_dump.json')
accounts=["account_1", "account_2", "account_3", "account_4", "account_5", "account_6.dev"]

for user in accounts:
    user_id = cl.user_id_from_username(user)

after calling cl.user_id_from_username(user) I get

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/kaufland/?__a=1) >>> for (;;);{"__ar":1,"error":1357004,"errorSummary":"Sorry, something went wrong","errorDescription":"Please try closing and re-opening your browser window.","payload":null,"hsrp":{"hblp":{"consistency":{"rev":1005632855}}},"lid":"7105342318905812221"}

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
LordAliClonercommented, Jun 20, 2022

After updating to 1.16.19 I get another error when trying to retrieve the user_id

cl = Client()
cl.load_settings('/home/python/ig_dump.json')
accounts=["account_1", "account_2", "account_3", "account_4", "account_5", "account_6.dev"]

for user in accounts:
    user_id = cl.user_id_from_username(user)

after calling cl.user_id_from_username(user) I get

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/kaufland/?__a=1) >>> for (;;);{"__ar":1,"error":1357004,"errorSummary":"Sorry, something went wrong","errorDescription":"Please try closing and re-opening your browser window.","payload":null,"hsrp":{"hblp":{"consistency":{"rev":1005632855}}},"lid":"7105342318905812221"}

finally found a way

just go to line 166 in public.py and edit public_a1_request=>

def public_a1_request(self, endpoint, data=None, params=None, headers=None):
        url = self.PUBLIC_API_URL + endpoint.lstrip("/")
        if params:
            params.update({"__a": 1,'__d':'dis'})
        else:
            params = {"__a": 1,'__d':'dis'}

@adw0rd

3reactions
tahakucukkatircicommented, Jun 4, 2022

same here

Read more comments on GitHub >

github_iconTop Results From Across the Web

POST request status code 200 not allowing json conversion
To me this seems like there is a redirect happening. Maybe just delete &redirect_uri=https://XXXXXX.com from URL.
Read more >
Issues · adw0rd/instagrapi - GitHub
Change PFP Error Photo Upload failed with the following response: <Response [400]> bug ... login_required issue coming every time I make public request....
Read more >
How to get around JSON Decode error while retrieving token ...
When I run the code, I get a JSONDecodeError: Expecting value: line 1 column 1 (char 0) which, to me, implies the JSON...
Read more >
Intermittent JSONDecodeError in Hub REST API Python
Ideally REST API calls when the bearer token expires should return an HTTP response status code of 401 or 403 as opposed to...
Read more >
json parse error - expecting value: line 1 column 1 (char 0)
It is possible the server responded with a 204 No Content response, or a non-200-range status code was returned (404 Not Found, etc.)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found