mifi / instauto

Instagram bot / automation library written in Javascript for Node.js
808 stars 145 forks source link

Failed to get user data from page #124

Open Flamintus opened 2 years ago

Flamintus commented 2 years ago

Here is a new error I encounter, I think about se same "softban" from IG as #112

Using await instauto.unfollowNonMutualFollowers();

2022-08-31T05:54:26.085Z Trying to get user data from HTML 2022-08-31T05:54:26.085Z Navigating to user eduardo_frn 2022-08-31T05:54:26.085Z Goto https://www.instagram.com/eduardo_frn 2022-08-31T05:54:31.791Z Page loaded 2022-08-31T05:54:31.791Z Waiting 3.21 sec 2022-08-31T05:54:35.036Z Failed to get user data from page SyntaxError: Unexpected token O in JSON at position 72189 at JSON.parse () at getUserDataFromPage (C:\Users\User\Desktop\Instauto\node_modules\instauto\src\index.js:277:22) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async navigateToUserAndGetData (C:\Users\User\Desktop\Instauto\node_modules\instauto\src\index.js:325:20) at async doesUserFollowMe (C:\Users\User\Desktop\Instauto\node_modules\instauto\src\index.js:1060:30) at async condition (C:\Users\User\Desktop\Instauto\node_modules\instauto\src\index.js:1104:25) at async safelyUnfollowUserList (C:\Users\User\Desktop\Instauto\node_modules\instauto\src\index.js:803:13)

mifi commented 2 years ago

Any chance you could get the html from the page or a screenshot?

Flamintus commented 2 years ago

I will try I can say at this time that le letter is changing 2022-08-31T11:30:08.515Z Failed to get user data from page SyntaxError: Unexpected token L in JSON at position 26195 2022-08-31T11:30:36.113Z Failed to get user data from page SyntaxError: Unexpected token e in JSON at position 12938 2022-08-31T11:30:36.113Z Failed to get user data from page SyntaxError: Unexpected token e in JSON at position 12938 2022-08-31T11:33:48.377Z Failed to get user data from page SyntaxError: Unexpected token C in JSON at position 24289

Also, it randomly happened till the time where it happen everytime

Flamintus commented 2 years ago

Here is a screenshot (I am unable to get the follower list)

It look like HTTP 429 mean To many request -> So it's not depending from Follow, the simple fact to check follower list too much give me this ShadowBan -> Maybe we have to fix unfollowNonMutualFollowers to avoid reading too much information too fast (if I have 2k followers and the same 2k following it will quickly do 2k request on /following witch can be shadowbaned

image

mifi commented 2 years ago

Oh yea, maybe we need to have a global event that gets triggered and handled if any request fails with 429