mifi / instauto

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

Login using Session cookies #53

Closed toppersdesk closed 3 years ago

toppersdesk commented 3 years ago

I was looking for an API like this, which is still maintained I guess. Great work by the developers. I stumbled upon some ideas to improve this: 1.) if I could be able to install this on a server (a method like this) and let it run for a long period + sending an error notification on email if something went wrong.

2.) (Maybe better approach OR already in use which I'm unaware of) Using session cookies to login (similar to this service) to avoid bot detection.

I'm completely new to node.js but gonna try making the first option work. I will appreciate it if someone could help with this.

mifi commented 3 years ago

Hi

  1. I think running it on a server is a bit risky because Instagram thinks that it not a real user due to a cloud IP
  2. I'm not sure if cookies will improve the situation. If instgram sees the request coming from a cloud IP, they could still suspect something wrong. See here for how to set up on a server: https://github.com/mifi/instauto#running-with-pm2
toppersdesk commented 3 years ago

Thanks a lot @mifi for this great API. Currently, I'm using your Simpleinstabot but there are two reasons I wanna go with server setup, firstly the simpleinstabot needs a stable internet connection with higher data limits (as it loads videos/images in posts for liking), and secondly, my laptop needs to be ON all day (otherwise the process get disrupted and bot gives unexpected results), which is not I plan to do. I tried their service and it's pretty smoothly running on my other account. I'm still trying to find out how they solved the cloud IP problem. Does using the headless browser in puppeteer will create any problems?

mifi commented 3 years ago

how many do you follow per hour with that service?

Does using the headless browser in puppeteer will create any problems?

you can use the stealth plugin like thi:S https://github.com/mifi/instauto/issues/16#issuecomment-607796635

toppersdesk commented 3 years ago

the service limits us to follow max 5 per launch and max 4 launches of script per hour. But I just use it to do 2 follows/ hr for 24hrs.

Will the stealth plugin help to hide the cloud IP?

mifi commented 3 years ago

ok, you can still login by using session cookies in instauto, but you need to manually put the cookies into cookies.json in the correct format.

Will the stealth plugin help to hide the cloud IP?

no, it will just make puppeteer look less like a headless browser and more like a normal google chrome

toppersdesk commented 3 years ago

Okay, I will try the stealth plugin with puppeteer in instauto because I couldn't find the option to run script on startup in simpleinstabot and no option to choose headless browser to reduce the internet data usage. Otherwise, simpleinstabot is perfect for the use. Thanks man.

mifi commented 3 years ago

see the issue i linked about for how to do stealth. headless browser will not reduce internet data usage but it will allow to run without any window GUI. see puppeteer docs.