Skip to content

Bad Request Error #19

@Lem0nTree

Description

@Lem0nTree

Before submitting an issue make sure you have:

  • Updated to the lastest version v0.3.8
  • Read the README
  • Searched the bugtracker for similar issues including closed ones

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions