Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise JSONDecodeError #32

Closed
sniper199 opened this issue Aug 21, 2020 · 1 comment · Fixed by #33
Closed

raise JSONDecodeError #32

sniper199 opened this issue Aug 21, 2020 · 1 comment · Fixed by #33

Comments

@sniper199
Copy link

sniper199 commented Aug 21, 2020

Hello @Datalux
i had this problems
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Attempt to login...
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/instagram_private_api/client.py", line 523, in _call_api
response = self.opener.open(req, timeout=self.timeout)
File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 77, in
api = Osintgram(args.id, args.file, args.json)
File "/root/Osintgram/src/Osintgram.py", line 28, in init
self.api = AppClient(auto_patch=True, authenticate=True, username=u, password=p)
File "/usr/local/lib/python3.8/dist-packages/instagram_private_api/client.py", line 208, in init
self.login()
File "/usr/local/lib/python3.8/dist-packages/instagram_private_api/endpoints/accounts.py", line 49, in login
login_response = self._call_api(
File "/usr/local/lib/python3.8/dist-packages/instagram_private_api/client.py", line 527, in _call_api
ErrorHandler.process(e, error_response)
File "/usr/local/lib/python3.8/dist-packages/instagram_private_api/errors.py", line 135, in process
raise ClientError(error_msg, http_error.code, error_response)
instagram_private_api.errors.ClientError: Bad Request: rate_limit_error

@Datalux
Copy link
Owner

Datalux commented Aug 21, 2020

Hi @sniper199 thank you for submitting this issue. This problem is related to the limit imposed by Instagram on the requests number (see https://developers.facebook.com/docs/graph-api/overview/rate-limiting#instagram).

In the next release I'll include a better exception management.

@Datalux Datalux linked a pull request Aug 22, 2020 that will close this issue
@Datalux Datalux closed this as completed Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants