-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support Challenge verification #3
Comments
Hi, Have you tried functions in challenge.go |
No sorry, I didn't saw. Could give an example please? Thanks! |
Try this:
|
For Challenge, this is correct? case errs.ChallengeRequired:
checkPointErr := err.(errs.ChallengeRequired)
address := checkPointErr.GetChallenge()
cs := gista_helpers.NewChallengeSolver()
ch, err := cs.GetChallengeByUrl(address.Url)
if err != nil {
fmt.Println(err)
return
}
chr, err := cs.GetSolveChallengeByEmail(address.Url, ch.Config.CsrfToken, ch.RollOutHash)
if err != nil {
fmt.Println(err)
return
}
reader := bufio.NewReader(os.Stdin)
fmt.Println((*chr.ExtraData.Content)[1].Text)
text, _ := reader.ReadString('\n') // Read verification code from terminal
chsr, err := cs.SolveChallenge(address.Url, ch.Config.CsrfToken, ch.RollOutHash, text)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(chsr) |
It is correct, let me know if it doesn't work. |
Does it happen after authorization? |
Getting authorization... And authorized is not related to Gista or Instagram. I think that the challenge was correctly made since But after, doing anything with the account throw a runtime error so I guess that it's not logged properly. |
Do you have any idea whats wrong with my code? |
I forgot to mention, you need to re-login after the verification. Repeat the login code after SolveChallenge. ChallengeSolver works with Instagram web api, Gista works with Instagram Private API. That's why Solver is not built-in and is considered a helper. If you still get challenge required error, it's because the instagram account you're trying to log-in to has been logged in with a newer API. You can change these constants to newer API constants or de-activate the account and wait for at least 3 hours, and then login to account using the old constants.
|
case errs.ChallengeRequired:
checkPointErr := err.(errs.ChallengeRequired)
address := checkPointErr.GetChallenge()
cs := gista_helpers.NewChallengeSolver()
ch, err := cs.GetChallengeByUrl(address.Url)
if err != nil {
fmt.Println(err)
return
}
chr, err := cs.GetSolveChallengeByEmail(address.Url, ch.Config.CsrfToken, ch.RollOutHash)
if err != nil {
fmt.Println(err)
return
}
reader := bufio.NewReader(os.Stdin)
fmt.Println((*chr.ExtraData.Content)[1].Text)
text, _ := reader.ReadString('\n') // Read verification code from terminal
chsr, err := cs.SolveChallenge(address.Url, ch.Config.CsrfToken, ch.RollOutHash, text)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(chsr)
ig.login(username, password, false) So I need to end the catch with a login function like this? And thanks, I'll try for the other constants.. |
Correct, also check for the errors in the second login too. Gista will only work if there are no errors, the nil pointer error you saw was because of that. |
It worked fine! Thanks. |
Hi,
It would be great to support Challenge Verification like on goinsta, ahmdrz/goinsta#198.
Thanks!
The text was updated successfully, but these errors were encountered: