ping / instagram_private_api

A Python library to access Instagram's private API.
MIT License
2.94k stars 608 forks source link

Can't get user info via user_info2 anymore #392

Open tahakucukkatirci opened 2 years ago

tahakucukkatirci commented 2 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Which client are you using?


Describe the Bug/Error:

When I am trying to fetch user_info via user_info2 method in web_api, I am getting error. It works fine in the initial request, but not in the following requests. Here is the code and the response I get. I also faced the issue when I try in the browser as well. I think Instagram has updated its API. Anyone encountering this bug?

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":1005632913}}},"lid":"7105412861952089317"}

Python 3.6.10 :: Anaconda, Inc.

Code:

api = Client(settings=cached_settings)
user = api.user_info2('instagram')

Error/Debug Log:

JSONDecodeError                           Traceback (most recent call last)
<ipython-input-67-d47f0623923e> in <module>
----> 1 user = api.user_info2('instagram')
      2 user

~/anaconda3/envs/myenv/lib/python3.6/site-packages/instagram_web_api/client.py in user_info2(self, user_name, **kwargs)
    431        endpoint = 'https://www.instagram.com/{username!s}/'.format(**{'username': user_name})
    432        try:
    433             info = self._make_request(endpoint, query={'__a': '1'})

~/anaconda3/envs/myenv/lib/python3.6/site-packages/instagram_web_api/client.py in _make_request(self, url, params, headers, query, return_response, get_method)
    283             self.logger.debug('RES BODY: {0!s}'.format(response_content))
--> 284             return json.loads(response_content)
    285 
    286         except compat_urllib_error.HTTPError as e:

~/anaconda3/envs/myenv/lib/python3.6/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    352             parse_int is None and parse_float is None and
    353             parse_constant is None and object_pairs_hook is None and not kw):
--> 354         return _default_decoder.decode(s)
    355     if cls is None:
    356         cls = JSONDecoder

~/anaconda3/envs/myenv/lib/python3.6/json/decoder.py in decode(self, s, _w)
    337 
    338         """
--> 339         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    340         end = _w(s, end).end()
    341         if end != len(s):

~/anaconda3/envs/myenv/lib/python3.6/json/decoder.py in raw_decode(self, s, idx)
    355             obj, end = self.scan_once(s, idx)
    356         except StopIteration as err:
--> 357             raise JSONDecodeError("Expecting value", s, err.value) from None
    358         return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
yfenes commented 2 years ago

same here

ali-moroukian commented 2 years ago

https://stackoverflow.com/questions/11796349/instagram-how-to-get-my-user-id-from-username/38342137#38342137