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

Bad Request Error #19

Open
3 tasks done
Lem0nTree opened this issue Nov 1, 2019 · 5 comments
Open
3 tasks done

Bad Request Error #19

Lem0nTree opened this issue Nov 1, 2019 · 5 comments

Comments

@Lem0nTree
Copy link

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>
@NU11B0T
Copy link

NU11B0T commented Dec 2, 2019

Same Error. Any fix?

@jerryan9999
Copy link

Same Error too, hope the answer

@burraksumer
Copy link

burraksumer commented Apr 30, 2020

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
Copy link

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
Copy link

Any news?

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

No branches or pull requests

6 participants