Comments (20)
Tried it again, and got a different error message:
ClientError URLError <urlopen error [Errno 8] nodename nor servname provided, or not known> (Code: 0, Response: )
Did a little googling, and it seems these errors are being thrown by the underlying instagram_private_api, as suggested by this issue. The diagnosis is that Instagram these errors indicate that Instagram has flagged an account as spammy.
In instagram_private_api's README includes as a note recommending that users avoid excessive logins by caching the auth cookie.
Caching the auth cookie isn't instapy-cli's default behavior, correct? Is it an invokable option via the command line? If not, would you accept a pull request wherein we added this feature?
from instapy-cli.
Edit: Changed location and it's working now.
What do you mean by changing the location ? the location of your vpn ?
from instapy-cli.
Describe the bug
I excute same command every day. Since today, Instagram seems to require an verification. Instapy-cli display a "challenge_required" message.
To Reproduce
instapy -u myuser -p mypassword -f https://i.imgur.com/EaWUsOs.jpg -t "Comment se faire des amis"
Expected behavior
Sending a working instagram post.
Logs
If there are any errors or exceptions, add the logs to help explain your problem.ClientError checkpoint_challenge_required (Code: 400, Response: {"message": "challenge_required", "challenge": {"url": "https://i.instagram.com/challenge/13063477860/GhKeUCVT2D/", "api_path": "/challenge/13063477860/GhKeUCVT2D/", "hide_webview_header": true, "lock": true, "logout": false, "native_flow": true}, "status": "fail", "error_type": "checkpoint_challenge_required"})
Env (please complete the following information):
- OS: archlinux
- Python: 3.7.3
- instapy-cli Version: 0.0.12
Restart your wifi. Welcome.
from instapy-cli.
Restart wifi did not work for me.
from instapy-cli.
Restart wifi did not work for me.
Instagram will block both your ipaddress and account for suspicious acitivities.
like: Repetitive actions, Multiple Logins, and login from different locations(states,countries frequently) and PCs.
perhaps Instagram has blocked your IP address and account temporarily.
Change your IP address then run it again. Use a VPN or anything like a virtual server that can change your IP address. But run it wisely this time. Try to access another account from another computer.
Hope It will work.
from instapy-cli.
You are correct. Changing the ip does work. I changed to posting through my iphone hotspot and the post worked! Super great.
Wish there was a little more documentation on the cookies. I think it automatically uses the cookie if it has it. But is has to be renamed correctly. Should the cookie be: ie: BOBSMITH_id.json?
from instapy-cli.
I just ran into this as well. Tried changing the IP address by tethering the laptop to my phone, and got the same error. Will try again tomorrow. Otherwise, should we assume that our Instagram account has been permanently blocked from using this upload method?
Also, just to respond to @potter-potter: We have been logging in every time we upload a video (about every weekday). It isn't obvious to me if/how the locally stored cookie can be created or used from the command-line interface.
from instapy-cli.
You are correct. Changing the ip does work. I changed to posting through my iphone hotspot and the post worked! Super great.
Wish there was a little more documentation on the cookies. I think it automatically uses the cookie if it has it. But is has to be renamed correctly. Should the cookie be: ie: BOBSMITH_id.json?
Correct. USERNAME_ig.json
from instapy-cli.
@gordonje I'm not using command line. But I have had good luck with the cookie.
It needs to be named exactly as the instagram username with _ig.json. Not in capital letters as I first thought. So bobscookies2022_ig.json if the user is bobscookies2022. I used the cookie writer example to create the file and then renamed it correctly. It even works if I generate it on one computer (or phone hotspot) and use on a different computer (ip address)
As far as using it in my python script, as long as the file is in the same directory as the script, it will find the cookie file:
with client(username, password) as cli:
# get string cookies. Not sure if this is necessary.
cookies = cli.get_cookie()
cli.upload(image_path, full_caption)
from instapy-cli.
@potter-potter Thanks for pointing that out.
Full disclosure: I discovered this library while researching options for work colleague who isn't a Pythonista or a developer of any sort. I taught him how to open his terminal app and type in the command for uploading his daily videos to his show's Instagram account. Accept for this blocking issue that came up, it's been working really well for him. So I'm eager for a resolution that allows him to continue using the command line.
from instapy-cli.
Another update: After my colleague logged out of his Instagram account on his phone, logged back in, and waited for a couple of days, he is once again able to upload videos from the command line.
Still interested in whether or not caching the auth cookie is/could be added to the CLI.
from instapy-cli.
Hey guys, currently playing around with this. If i execute the example of creating the cookie (https://github.com/instagrambot/instapy-cli/blob/master/examples/login-cookie-write-file.py) with my username and pw i dont seem to be creating a cookie file. it should be in the same local directory or not?
The documentation is confusing on this topic as the example is sadly not commented. Lets say my username is "FruechteBini" and my passwort is "orange123", if i execute the script like this:
from instapy_cli import client
username = 'FruechteBini'
password = 'orange123'
cookie_file = 'FruechteBini_ig.json' # default: `USERNAME_ig.json`
with client(username, password, cookie_file=cookie_file, write_cookie_file=True) as cli:
# get string cookies
cookies = cli.get_cookie()
print(type(cookies)) # == str
print(cookies)
# do stuffs with cli
ig = cli.api()
me = ig.current_user()
print(me)
i instantly get the [IG] not found cookie/cookie_file >> login as default
message. Shouldnt this script create the cookie? I am confused, any hint in the right direction is appreciated!
EDIT: i am building a IG-photobox for a party - pressing a button will automatically upload the picture to instagram story. Everything is working besides instagram detecting suspicious behaviour for logging in everytime I call instapy-cli..
from instapy-cli.
Ok, i got it to work. The problem was that once you are blocked (from IG, the IP or whatever) you cant create the cookie file anymore. This instapy_cli is great work but i still think the documentation on the cookie stuff should be a bit more detailed. A quick heads-up that you get banned if you dont use cookies and want to do frequent stuff for example. Nevertheless thanks for the feature, cheers!
from instapy-cli.
Uff, i actually do have trouble with this aswell - my cookie does not get generated if i use the generation script and it always says:
ClientError checkpoint_challenge_required (Code: 400, Response: {"message": "challenge_required", "challenge": {"url": "https://i.instagram.com/challenge/integerValues/String/", "api_path": "/challenge/integerValues/String/", "hide_webview_header": true, "lock": true, "logout": false, "native_flow": true}, "status": "fail", "error_type": "checkpoint_challenge_required"})
so i will wait a bit as recommended here and once i get it to work i call back
- M.
from instapy-cli.
@Grizzaka - yeah! I think you can
A) just wait until instagram unblocks you or
B) as others said (haven't tried it my self) get a new IP (eg. restart router) - could do the trick aswell.
And dont try to upload a story/post before generating the cookie - i assume this attempt will block you again.
from instapy-cli.
@FruechteBini I switched to my personal account and it worked like a charm - without any problems i was able to upload a photo and an entire story (even without cookie) - so yea it was the other account who made some trouble.
i waited a few days now and even the other account works now.
+1
from instapy-cli.
I'm still having the same problem. I have tried several different accounts and IP combinations. It will not write the cookie file. Do I need to log off on the iPhone?
Edit: Changed location and it's working now.
from instapy-cli.
i think it seems like ig detect a bot and ban the use of this api. What do you think?
from instapy-cli.
Edit: Changed location and it's working now.
Could you please provide more details about what is means this? Did you changed the IP address? Thanks
from instapy-cli.
I'm failing on this same challenge ClientError checkpoint_challenge_required (Code: 400, Response
...
Does anyone have an example of what a working USERNAME_ig.json
looks like?
Can I copy a cookie from my browser after successfully logging in?
from instapy-cli.
Related Issues (20)
- Unable to upload HOT 1
- simple jpg upload from CLI or Python script won't work... [BUG] HOT 2
- [BUG] cannot upload an image HOT 3
- [BUG] can't upload image HOT 1
- Can't upload image[. BUG] HOT 9
- [BUG] Getting Something went wrong while uploading photo HOT 2
- [BUG] HOT 5
- How to post a photo album?[F+] HOT 1
- I can't upload photos HOT 9
- can i post instagram reels with instapy? [F+] HOT 1
- [BUG]"error_type": "checkpoint_challenge_required"
- [BUG] HOT 2
- Issue: Duration is too short error.
- [BUG] Upload function Says, Error parsing error response: Expecting value: line 1 column 1 (char 0) HOT 2
- [BUG] Unknown error (Something went bad)
- [BUG] I CAN NOT LOG IN TO INSTAGRAM ACCOUNT TO USE CODE. NOT COOKIE FILE FOUND. HOT 1
- [BUG] Error parsing error response: Expecting value: line 1 column 1 (char 0) HOT 4
- Error is >> Bad Request HOT 7
- ModuleNotFoundError: No module named 'instapy_cli' HOT 4
- Unable to upload photo on insta. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instapy-cli.