Davincible / goinsta

Unofficial Instagram API written in Golang (v2022)
MIT License
183 stars 56 forks source link

Sync returned empty public key and/or public key id #22

Closed dsdenes closed 2 years ago

dsdenes commented 2 years ago

Dear @Davincible, first of all thank you for this great fork!

I've encountered an error when trying to log in:

Here pubKeyID has a value of 0

if insta.pubKey == "" || insta.pubKeyID == 0 {
  return errors.New("Sync returned empty public key and/or public key id")
}

Here are the response headers accordingly:

Ig-Set-Password-Encryption-Key-Id:[0] 
Ig-Set-Password-Encryption-Pub-Key:[LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFwS3kvVUEzeVJLc2lMNkZ5Z2tiawpidXlGRmJldldXM3dzSHh5d1lRaWV0cHlLcXdlMmd3c2hNa2FTVGpibnFlcFdRRTI2Qk9DNmlLNmpydEREZGpMClNxc3hxRzJrNTA4aG5yYjBOdDZJNU5pY2FtSEV3VVNFUU1pUnphcExjM3hzUzRWK09IZ1lxeGY2dWFscHVENnMKa0gvTzJmdzRrSTg1SXAxcTZUN3VCQ0M4aHFIYXhQNkRPM29ubjFrbzRGeDRlcjVoSHNWV0UxN01wRDBLUWlHbgpNZWN3dVJUTi9lTDEyb090Rm5aMndGMU51TlllNTRBaCtUQmp5VVMyQ0dlQ01EenpDczA4akVKSkRGM0V4OTJwClkvS3A4RS9HcHQycy94enJsOHlZUkRWNyt1Y0tDVDZTd1lkVVZOUVNMUjFYODNSb2p6UU16dUZ5OWN4TExkRkkKcndJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg==]

And here is the code that I try to run

  insta := goinsta.New("account-name", "some-password")
  insta.Debug = true

  if err := insta.Login(); err != nil {
    panic(err)
  }

In the login sequence both the first and the second sync before the login have Ig-Set-Password-Encryption-Key-Id:[0] in the response headeers.

Davincible commented 2 years ago

Thanks for the clear report. Should be fixed now