Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Updated endpoints to v2021 and fix for login issues #353

Open
Davincible opened this issue Aug 18, 2021 · 4 comments
Open

Updated endpoints to v2021 and fix for login issues #353

Davincible opened this issue Aug 18, 2021 · 4 comments

Comments

@Davincible
Copy link

Davincible commented Aug 18, 2021

The code in this repo is based on a 2yo app version, and since then, quite a lot has changed. From the way insta makes the requests, to the endpoints themselves. This has also caused the occasional login issue. I needed an up-to-date insta API in go for a project, so I've updated everything, and made it public in a fork. Everything should fully work again now.

@hexakis
Copy link

hexakis commented Aug 18, 2021

I was having this problem where I could not login, but a few days later after that I tried again and it just worked
my issue was probably unrelated to the change to Instagram's API. Why it continues to work when Instagram has changed their endpoints is behond me I suspect backwards compatability with older version of Instagram running on old phones being the reason,

@Davincible
Copy link
Author

Davincible commented Aug 19, 2021

@hexakis The reason it stopped and started working is both this lib as well as the official android apk call two endpoints during the login process accounts/get_prefill_candidates/. accounts/contact_point_prefill/, that are very sensitive and often return an HTTP status code 429, too many requests. This also happens with the official app however, but it just ignores it as they are not critical to the login process, this lib however, returns every error it finds, and therefore the whole login process errors out.

As far as why the rest does continue to work, it is due to backward compatibility. Quite a few things have changed, however. The main being that they stepped away from conventional cookies and csrf tokens, and put everything in a bunch of separate headers. The endpoints also changed slightly, some are called with different parameters, and some return a different result now

@Davincible Davincible changed the title Fix for login issues Updated endpoints to v2021 and fix for login issues Aug 24, 2021
@PhantomX7
Copy link

@Davincible i got this Failed to fetch initial messages inbox snapshot: json: cannot unmarshal object into Go struct field Item.inbox.threads.last_permanent_item.link of type string panic error when using your fork. is there any way to solve this?

@Davincible
Copy link
Author

Davincible commented Aug 24, 2021

@PhantomX7 Ah, yeah we can fix that. Some endpoints have changed their data format, and as I haven't seen all possible responses I have not seen all data type mismatches yet. Could you please open an issue on my fork? I'll have a look.

Edit: Nevermind, should be fixed now! Make sure to update the repo with go get -u -v github.com/Davincible/goinsta@latest

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants