mifi / instauto

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

Failed to process follower {{username}} Error: User not found #148

Open thefakewater opened 1 year ago

thefakewater commented 1 year ago

To Reproduce I started my bot at 1PM at and It ran good until 5:30PM so 4:30PM of good services. After that I got an error and now my bot can't follow anyone due to that "black page"

Screenshot <img width="1000" alt="Screenshot 2023-05-04 210805" src="https://i.imgur.com/DSUrR24.png"> Instagram works on every pages except when you wanna access an user page (yours or another person's page) on computer. The phone is not being ratelimited. Desktop (please complete the following information): Check #147

Provide me with HTML Output HTML of that "black page" html.txt Suddenly an error happened after 4 hours and 30 of uptime

2023-05-04T15:30:08.107Z Failed to manually send request Error: Evaluation failed: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at ExecutionContext._ExecutionContext_evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:258:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (/app/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:146:16)
    at async Timeout._onTimeout (/app/node_modules/instauto/src/index.js:297:11)
2023-05-04T15:30:08.111Z Failed to process follower echahrawiamina SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at getUserDataFromInterceptedRequest (/app/node_modules/instauto/src/index.js:318:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async navigateToUserAndGetData (/app/node_modules/instauto/src/index.js:337:16)
2023-05-04T15:30:08.112Z Waiting 39.72 sec
    at async followUserRespectingRestrictions (/app/node_modules/instauto/src/index.js:718:25)
    at async processUserFollowers (/app/node_modules/instauto/src/index.js:786:49)
    at async Object.processUsersFollowers [as followUsersFollowers] (/app/node_modules/instauto/src/index.js:817:9)
    at async /app/index.js:151:5

I think that error started to happen when the bot saw the black Instagram page in screenshot Since that error happened every time the bot wants to go to a user page to follow them it gets the same new error.

2023-05-04T15:30:47.832Z Trying to get user data from HTML
2023-05-04T15:30:47.832Z Navigating to user {{username}}
2023-05-04T15:30:47.832Z Goto https://www.instagram.com/{{username}}
2023-05-04T15:30:56.429Z Page loaded
2023-05-04T15:30:56.429Z Waiting 3.77 sec
2023-05-04T15:31:00.271Z Cannot find text "{{username}}" on page
2023-05-04T15:31:00.271Z Failed to process follower {{username}} Error: User not found
    at navigateToUserWithCheck (/app/node_modules/instauto/src/index.js:248:50)
2023-05-04T15:31:00.273Z Waiting 23.36 sec
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async navigateToUserAndGetData (/app/node_modules/instauto/src/index.js:327:5)
    at async followUserRespectingRestrictions (/app/node_modules/instauto/src/index.js:718:25)
    at async processUserFollowers (/app/node_modules/instauto/src/index.js:786:49)
    at async Object.processUsersFollowers [as followUsersFollowers] (/app/node_modules/instauto/src/index.js:817:9)
    at async /app/index.js:151:5

I checked the network tab on devtools and 2 request fails to ERROR 429 Too many requests so I guess I'm being ratelimited by Instagram

Screenshot 2023-05-04 210819

<img width="197" alt="Screenshot 2023-05-04 210805" src="https://user-images.githubusercontent.com/43514781/236304750-36fc7e3b-dad0-414c-aacb-fff590996430.png">

Question What I don't understand is that I followed only 75 persons during that 4 hours 30 minutes period and I got ratelimited why's that? If it's not the follow then it's maybe the likes? Here are my ENV vars

image

In that 4hours and 30 minutes I followed 75 persons and liked 175 images Do you think 175 Images liked is too much? I've read online that the max in 24 hours would be 300-400 but they recommended 200 per day so that's what I did (see above) Source Is there a MAX_LIKES_PER_HOUR variable @mifi ?

mifi commented 1 year ago

probably same as #16 #112

Is there a MAX_LIKES_PER_HOUR variable @mifi ?

not yet