ping / instagram_private_api

A Python library to access Instagram's private API.
MIT License
2.94k stars 608 forks source link

Is there a way to initialize/authenticate the client without username & password? #391

Open tahakucukkatirci opened 2 years ago

tahakucukkatirci commented 2 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Which client are you using?


Describe your Question/Issue:

I can login with username and password and then don't need them anymore after I save the settings. No problem with that. I wonder if there is a way to authenticate the user in the initial login without username and password? Maybe by using some cookie values and passing them into the client. Couldn't figure out a way to do this.


Paste the output of python -V here:

Python 3.6.10 :: Anaconda, Inc.

Code:


# Example code that will produce the error reported
from instagram_web_api import Client

web_api = Client()
user_feed_info = web_api.user_followers('1234567890', count=10)
``
MehdiJafari84 commented 4 months ago

Hello, Yes, Instagram has an endpoint to login with cookie, I wrote a Chrome extension to get Insta cookie from browser and save it in local storage then I can read cookie in my web app and send it to Insta private api to login without getting username and password. I'm using this repo . this library has a method called LoginWithCookie so private api can handle this process, I dont know this repo has this method or no, Anyway you can do it.