ping / instagram_private_api

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

user_info2 raises ValueError #230

Open sp1thas opened 4 years ago

sp1thas commented 4 years ago

Before submitting an issue, make sure you have:

Which client are you using?


Describe the Bug/Error:

Then I'm trying to use user_info2 method from a Client object I'm getting ValueError


Python version: Python 2.7.15rc1

Code:

from instagram_web_api import Client, ClientCompatPatch, ClientError, ClientLoginError

web_api = Client()
user = web_api.user_info2('instagram')

Error/Debug Log:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/simakis/.p2env/local/lib/python2.7/site-packages/instagram_web_api/client.py", line 430, in user_info2
    info = self._make_request(endpoint, query={'__a': '1'})
  File "/home/simakis/.p2env/local/lib/python2.7/site-packages/instagram_web_api/client.py", line 284, in _make_request
    return json.loads(response_content)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
aegroto commented 4 years ago

I've got a similar issue:

  File "/root/instagram_private_api/instagram_web_api/client.py", line 433, in user_info2
    info = self._make_request(endpoint, query={'__a': '1'})
  File "/root/instagram_private_api/instagram_web_api/client.py", line 284, in _make_request
    return json.loads(response_content)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
jhill-cmd commented 4 years ago

Looks like it has become an instagram limitation.?

API graph v2.12 will be deprecated on May 05, 2020.

How about using: https://www.instagram.com/USERNAME/?__a=1

like https://www.instagram.com/instagram/?__a=1