ahmdrz / goinsta

Unofficial Instagram API written in Golang
MIT License
895 stars 247 forks source link

Unable to login #346

Open bojanmilinkovic opened 3 years ago

bojanmilinkovic commented 3 years ago

When I pass my credentials and try to login calling method Login(), I get the error: Please wait a few minutes before you try again Can someone help please?

websines commented 3 years ago

@bojanmilinkovic I found the issue. I guess you are running from a webserver like me, this makes Instagram think that a bot is trying to log in and blocks it. I found the solution is to send the insta.Login() with a http transport which has a proxy.

` insta := goinsta.New(username, password)

proxyUrl, err := url.Parse("http://yourproxy:port")
if err != nil {
    log.Fatalf("Error: %s", err)
}
httpClient := &http.Client{Transport: &http.Transport{Proxy: http.ProxyURL(proxyUrl)}}
insta.SetHTTPClient(httpClient)
if err := insta.Login(); err != nil {
    log.Fatal(err)
}

`

However now what happens in when I send a request with this it returns an error

{"message":{"Op":"Post","URL":"https://i.instagram.com/api/v1/accounts/read_msisdn_header/","Err":{}}}

I do not know what this means, hopefully you can find something, maybe my transport code is wrong. Let me know if you can get something.

vaebhav commented 3 years ago

@bojanmilinkovic - Faced a similar error while trying to insta.Login(). Its a general thing that instagram does and blocks the user's access as you might have been mimicking a bot. The error prompt/down time will cease of within 12-24 hours.

websines commented 3 years ago

@vaebhav did it work for you? I tried with a lot of proxies using the insta.SetProxy(), but didn't work for me like I said above? Can you help me with this?

vaebhav commented 3 years ago

@websines - i dont use proxies to login, i meant i faced a similar issue while using the traditional way - 'insta.New()' and 'Login()', and was getting the same error which phased out after 1-2 days of inactivity

Davincible commented 3 years ago

see https://github.com/ahmdrz/goinsta/issues/353

AustinMCrane commented 3 years ago

this is still broken, seems like maybe a better explination of how to do a basic login would be great. or if there is a waiting period for use then explaining that