instagram_private_api
instagram_private_api copied to clipboard
Can't get user info via user_info2 anymore
Please follow the guide below
- Issues submitted without this template format will be ignored.
- Please read the questions carefully and answer completely.
- Do not post screenshots of error messages or code.
- Put an
x
into all the boxes [ ] relevant to your issue (==> [x] NO spaces). - Use the Preview tab to see how your issue will actually look like.
- Issues about reverse engineering is out of scope and will be closed without response.
- Any mention of spam-like actions or spam-related tools/libs/etc is strictly not allowed.
Before submitting an issue, make sure you have:
- [x] Updated to the lastest version v1.6.0
- [x] Read the README and docs
- [x] Searched the bugtracker for similar issues including closed ones
- [x] Reviewed the sample code in tests and examples
Which client are you using?
- [ ] app (
instagram_private_api/
) - [x] web (
instagram_web_api/
)
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)
same here
https://stackoverflow.com/questions/11796349/instagram-how-to-get-my-user-id-from-username/38342137#38342137