instagram_private_api
instagram_private_api copied to clipboard
error Bad Request
Please follow the guide below
- Issues submitted without this template format will be ignored.
- Rlease read them carefully and answer completely.
- Do not post screenshots of error messages or code.
- Put an
x
into all the boxes [ ] relevant to your issue (==> [x] no spaces). - Use the Preview tab to see how your issue will actually look like.
- Issues about reverse engineering is out of scope and will be closed without response.
- Any mention of spam-like actions or spam-related tools/libs/etc is strictly not allowed.
Before submitting an issue, make sure you have:
- [x ] Updated to the lastest version v1.6.0
- [x ] Read the README and docs
- [x ] Searched the bugtracker for similar issues including closed ones
- [x ] Reviewed the sample code in tests and examples
Which client are you using?
- [x ] app (
instagram_private_api/
) - [ ] web (
instagram_web_api/
)
Describe your Question/Issue:
Please make sure the description is worded well enough to be understood with as much context and examples as possible.
Hi, i've been usign this api for a few months now, i use it to schedule posts directly from my pc, all has been working fine until today. i'm getting a "Bad request" error, seems to be different from the usual instagram blocks, a friend of mine uses the same code and it also stopped working today. Instagram changed some stuff in the last update, could that be it? Is someone else having issues posting as well?
Paste the output of python -V
here:
Python 3.7.3
Code:
def new_photo(api,photo,caption,loc,com,page_id):
photo_data = open(photo, "rb").read()
size = (1080, 1080)
try:
post = api.post_photo(photo_data, size=size, caption=caption, location=loc)
print("\nPostado no Instagram!")
except Exception as e:
print("ALGO DEU ERRADO NA POSTAGEM!\n" + str(e))
print ("Tentando de novo...")
wait_for(30)
print ("Nova tentativa:")
post = api.post_photo(photo_data, size=size, caption=caption, location=loc)
print("\nPostado no Instagram!")
Error/Debug Log:
Error parsing error response: Expecting value: line 1 column 1 (char 0) ALGO DEU ERRADO NA POSTAGEM! Bad Request
Getting the same error for about 23 hours.
Most private instagram api's have similar problems for the last 2 days. Maybe Instagram is chancing something.
:/
I'm having the same issue as well. Has anyone found a fix?
Same here. Tried multiple proxies / residential IP's and different private API's. IG defnitly changed something...
seems to be working again for me. i'm a little scared to keep using it though, does someone know what happened? i heard some people are getting blocked permanently
yes this is working again, any news why ?
ig said they had closed this endpoint for good.. changed their mind ?
and it stopped again...
parou mesmo
and it stopped again... 2
any news on this?
This also happens to me. Maybe wrong headers?
I need this solved ASAP.
I have the same error when I upload a photo. I am on Python 3.8, Linux Manjaro :
` 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 "/usr/lib/python3.8/site-packages/instagram_private_api/endpoints/upload.py", line 446, in post_photo 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 "./instagram.py", line 12, in
I tried this package and tried php package from mgp25(it worked till oct. 2019, but now has same issue: 400 bad request
).
ps: NodeJS package work fine for me
@acrossoffwest could you give a link to a NodeJS package? I am going to try to compare requests between these two packages. Maybe I will be able to figure out the problem.
@pbotsman instagram-private-api
In this time the post_photo method is working or not ? for me this is return Bad Request help me guys ASAP
@pbotsman any progress?
@discotroll65 no luck 😞
any news on this?
safe to say this api is dead?
curl 'https://www.instagram.com/rupload_igphoto/fb_uploader_1557924189090'
-H 'cookie: mid=XNvymQAEAAFb4YRR4JkElxTB8I2_; csrftoken=IEpfr1jO1kB4EOFblQE285c9h5vD1LSh; ds_user_id=12828973541; sessionid=12828973541%3AXYcFYbRfWuitX7%3A23; rur=FRC; urlgen="{\"83.242.226.146\": 8359}:1hQtFJ:UiVB7Sl3c0NxnZh7VB9XujhuDGc"'
-H 'origin: https://www.instagram.com'
-H 'accept-encoding: gzip, deflate, br'
-H 'accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7'
-H 'user-agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1'
-H 'x-requested-with: XMLHttpRequest'
-H 'x-csrftoken: IEpfr1jO1kB4EOFblQE285c9h5vD1LSh'
-H 'x-ig-app-id: 1217981644879628'
-H 'x-entity-name: fb_uploader_1557924189090'
-H 'offset: 0'
-H 'x-instagram-ajax: 748957cebea4'
-H 'content-type: image/jpeg'
-H 'accept: */*'
-H 'authority: www.instagram.com'
-H 'x-instagram-rupload-params: {"media_type":1,"upload_id":"1557924189090","upload_media_height":1080,"upload_media_width":1079}'
-H 'x-entity-length: 16620'
-H 'referer: https://www.instagram.com/create/details/'
--data-binary $'ÿØÿà\u00\u10JFIF\u00\u01\u01\u00\u00\u01\u00\................. --compressed ;
The problem is with the endpoin being used in the library. The above curl request seems to be working....so to make the upload method work again, the endpoint needs to be updated.
Do you know how to do this? Can you make a pull request?
Still can't upload photo :(
/usr/local/lib/python3.7/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)
WARNING:instagram_private_api.errors:Error parsing error response: Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/instagram_private_api/endpoints/upload.py", line 446, in post_photo
@eduardoegos I don't have to time to inspect the uploader function, meanwhile, you can use the Instabot that is uploaded here: https://github.com/MessiDaGod/instabot-master
Upload example:
from instabot import Bot
bot = Bot()
bot.login(username="UserName", password="Password")
bot.upload_photo("custom.jpg", caption="Nice pic!")
print("OK")
I think the problem is that there is no User-Agent...
Did anyone get some progress? I was seeing and looks like this library just works with Python 2.7 and beta 3.5. https://github.com/ping/instagram_private_api
@Suleman-Elahi
@eduardoegos I don't have to time to inspect the uploader function, meanwhile, you can use the Instabot that is uploaded here: https://github.com/MessiDaGod/instabot-master
Upload example:
from instabot import Bot bot = Bot() bot.login(username="UserName", password="Password") bot.upload_photo("custom.jpg", caption="Nice pic!") print("OK")
Hey?? This repo is archived! Did you use this code? Did you get any ban from Instagram?
https://github.com/MessiDaGod/instabot-master
That don't work for me :
hamdy@hamdy-pc ~/Documents/instabot-master master python test.py
Traceback (most recent call last):
File "test.py", line 3, in
https://github.com/MessiDaGod/instabot-master
I tried this and It works. But I am not sure if we use it continuously, So Instagram will detect it and ban the account or not. Have anyone tried it for a long time? Did anyone experience a ban from Instagram using this bot code?
https://github.com/MessiDaGod/instabot-master
I tried this and It works. But I am not sure if we use it continuously, So Instagram will detect it and ban the account or not. Have anyone tried it for a long time? Did anyone experience a ban from Instagram using this bot code?
Well if you abuse the endpoints then you will definitely get banned.
https://github.com/MessiDaGod/instabot-master I tried this and It works. But I am not sure if we use it continuously, So Instagram will detect it and ban the account or not. Have anyone tried it for a long time? Did anyone experience a ban from Instagram using this bot code?
Well if you abuse the endpoints then you will definitely get banned.
I just want to use it to upload photos to Instagram. Is it fine to hit the endpoint 6-7 time in an hour? Or is it too much or less?
https://github.com/MessiDaGod/instabot-master I tried this and It works. But I am not sure if we use it continuously, So Instagram will detect it and ban the account or not. Have anyone tried it for a long time? Did anyone experience a ban from Instagram using this bot code?
Well if you abuse the endpoints then you will definitely get banned.
I just want to use it to upload photos to Instagram. Is it fine to hit the endpoint 6-7 time in an hour? Or is it too much or less?
Ideally it shouldn't. But never used by myself so can't say.
Any updates??
I guess theres a request limit cause I'm not able to login in the specific account