subzeroid / instagrapi

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

[BUG] Receiving a JSON Parse error #752

Closed ItzmeSwapy closed 2 years ago

ItzmeSwapy commented 2 years ago

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/myusername/?__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":1005773003}}},"lid":"7114874598313241892"}

this is the error that I am receiving

adw0rd commented 2 years ago

@ItzmeSwapy show your code and full traceback

kingbotss commented 2 years ago

for (;;); Your response has it. So it is throwing error. Publc_request may not work all the time. You may need to have login.

adityaa-codes commented 2 years ago

try using user_info_by_username_v1(username)

MHCloner commented 2 years ago

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/myusername/?__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":1005773003}}},"lid":"7114874598313241892"}

this is the error that I am receiving

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'}
ItzmeSwapy commented 2 years ago

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/myusername/?__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":1005773003}}},"lid":"7114874598313241892"}

this is the error that I am receiving

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'}

Thanks for responding, this might work

MHCloner commented 2 years ago

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/myusername/?__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":1005773003}}},"lid":"7114874598313241892"}

this is the error that I am receiving

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'}

Thanks for responding, this might work

😊

coisan commented 2 years ago

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/myusername/?__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":1005773003}}},"lid":"7114874598313241892"} this is the error that I am receiving

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'}

This worked for me too. Thanks!

MHCloner commented 2 years ago

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/myusername/?__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":1005773003}}},"lid":"7114874598313241892"} this is the error that I am receiving

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'}

This worked for me too. Thanks!

🙂🙂

trevtravtrev commented 2 years ago

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/myusername/?__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":1005773003}}},"lid":"7114874598313241892"} this is the error that I am receiving

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'}

This solution has now been merged into instagrapi as of yesterday. A new issue has now popped up where user data public_email and latitiude and longitude and (possibly more) are now all returning 'None' even when they should be returning something. Issues #774 and #775 are likely related. Any ideas how this could have caused those?

MHCloner commented 2 years ago

Status 200: JSONDecodeError in public_request (url=https://www.instagram.com/myusername/?__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":1005773003}}},"lid":"7114874598313241892"} this is the error that I am receiving

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'}

This solution has now been merged into instagrapi as of yesterday. A new issue has now popped up where user data public_email and latitiude and longitude and (possibly more) are now all returning 'None' even when they should be returning something. Issues #774 and #775 are likely related. Any ideas how this could have caused those?

Send me some examples

peter-rs commented 2 years ago

bump, this is not closed or resolved.