ping / instagram_private_api_extensions

An extension module to https://github.com/ping/instagram_private_api
MIT License
124 stars 26 forks source link

Bad Request Error #19

Open Lem0nTree opened 5 years ago

Lem0nTree commented 5 years ago

Before submitting an issue make sure you have:


Describe the Bug/Error:

Bad request error 400


Paste the output of python -V here:

Code: 3.7.5

# Example code that will produce the error reported

# post a photo
photo_data, photo_size = media.prepare_image(
    'test/test.jpg', aspect_ratios=MediaRatios.standard)
api.post_photo(photo_data, photo_size, caption='Hello World!')

Error/Debug Log:

python .\test.py
C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\site-packages\instagram_private_api\endpoints\upload.py:397: UserWarning: This endpoint has not been fully tested.
  warnings.warn('This endpoint has not been fully tested.', UserWarning)
Error parsing error response: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\site-packages\instagram_private_api\endpoints\upload.py", line 446, in post_photo
    response = self.opener.open(req, timeout=self.timeout)
  File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 569, in error
    return self._call_chain(*args)
  File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 503, in _call_chain
    result = func(*args)
  File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\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 ".\test.py", line 10, in <module>
    api.post_photo(photo_data, photo_size, caption='Hello World!')
  File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\site-packages\instagram_private_api\endpoints\upload.py", line 450, in post_photo
    ErrorHandler.process(e, error_response)
  File "C:\Users\loren\AppData\Local\Programs\Python\Python37\lib\site-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
PS C:\Users\loren\Desktop\tiktok\instagram api\instagram_private_api_extensions-master\tests>
NU11B0T commented 4 years ago

Same Error. Any fix?

jerryan9999 commented 4 years ago

Same Error too, hope the answer

burraksumer commented 4 years ago

Yep, I got the same error, it might be about Instagram's new API changes.

Edit: for anyone who is having a hard time as myself, I recommend to take a look at this API, it works for me.

megada-lab commented 4 years ago

Yep, I got the same error, it might be about Instagram's new API changes.

Edit: for anyone who is having a hard time as myself, I recommend to take a look at this API, it works for me.

Thank you! Not just working like a charm but it has plenty of functions and examples, and its pretty up-to-date!

Buckler89 commented 2 years ago

Any news?