Code Monkey home page Code Monkey logo

instagramfollowerbot's Introduction

Instagram Follower Bot

Bot for Instagram, in .Net Core, using Chrome and Selenium for actions.

Main functions :

  • Follow&Like with Insta Photos Explore
  • Unfollow people not following you
  • Follow back people following you
  • Like on Insta home page
  • Can work with a remote Selenium grid and/or in docker
  • Colored console trace or VSO format for Azure DevOps execition
  • Support ApplicationInsights (allow easier tracking of multiple context execution)

Tags : Instagram, Chrome, Selenium, C#, .Net, Core, bot, robot

Requirement

Notes

  • Selenium Chrome Driver must have the same version than your Chrome (change the lib version in the project if required)
  • Don't be evil, else Instagram will delete your spamming account
  • The solution is micro-service oriented, but Instagram will detected the spamming account if the bot is too fast
  • If you want to publish without remote Selenium, add _PUBLISH_CHROMEDRIVER in the DefineConstants of the .csproj
  • The account should follow at last one account, else the bot will fail to detect this
  • About "Unusual Login Attempt Detected" : If the bot connect from a location, OS, Browser that you never used before, you will get this email code chalenge. Pass it before lauching the bot again. You can change the OS/Browser (Chrome/Windows 10 by default) with the --user-agent in the SeleniumBrowserArguments setting.
  • Settings set by command line need to use : instead of __ depending on OS. Exemple : IFB_Logging:User

Usage

DotNet run

.NET Core

Download the sources and run donet sdk command in the folder of your Windows, Linux or Mac.

  • Run with default (users settings have been set in the .json or the environnement variable) :
dotnet run
  • On a daily base, unfollow users whose doesn't follow you :
dotnet run IFB_TaskManager__TaskList=DetectContactsUnfollowBack,DoContactsUnfollow [email protected] IFB_LoggingSecret__Password=Passw0rd

Docker run

Docker

  • Build and Run default IFB_TaskManager__TaskList with Docker with a remote Selenium Hub (here another docker) : Exemple with Z:\InstagramFollowerBot as the source path, on a Windows system
docker build -f Z:\InstagramFollowerBot\Dockerfile -t instagramfollowerbot Z:\InstagramFollowerBot
docker run --name seleniumContainer --detach --publish 4444:4444 selenium/standalone-chrome --volume /dev/shm:/dev/shm
docker run --link seleniumContainer:seleniumhost instagramfollowerbot [email protected] IFB_LoggingSecret__Password=Passw0rd IFB_Selenium__RemoteServer=http://seleniumhost:4444/wd/hub

Docker Compose run

Docker Compose

  • Build and Run default IFB_TaskManager__TaskList with Docker and an standalone Selenium

Exemple with IFB_Logging:User&IFB_Logging:Password provided in the InstagramFollowerBot.json or in the "environment:" of the docker-compose.yml

docker-compose up

Configuration

  • Main settings : Settings may be read in command line parameter, else in environnement variable, else in InstagramFollowerBot.json. Only IFB_Logging__User and IFB_LoggingSecret__Password won't have default working values from the initial configuration file. IFB_LoggingSecret__Password may be set to null in debug mode (the user will be able to insert the password himself)
Parameter Description
IFB_Logger_UseApplicationInsights Enable Microsoft Azure ApplicationInsights, you must define the environnement variable APPINSIGHTS_INSTRUMENTATIONKEY with your key
IFB_Logger_UseAzureDevOpsFormating Use a VSO log format instead of the default colored output, enable it if you run your bot through Azure DevOps pipeline
IFB_LoggingSecret__Password Password for auto-login, may be set to null if session file already created
IFB_Logging__User Email or UserName for login and filename for the session file
IFB_Dumping__DumpBrowserContextOnCrash In case of bot crash, generate a dump of the Chrome browser as .html for the html source and .png for the current view
IFB_Persistence__SaveFolder Where user informations (like cookie) are stored
IFB_Persistence__UsePersistence Will create a file for the user session and cookies
IFB_Selenium__RemoteServer Url of the Selenium Hub web service
IFB_TaskManager__TaskList Tasks to do, separatedd by a comma
  • Takss : Task name is case insensitive A lot of settings in order to randomize or limit the batch, in the Bot.Json
Name Description
CHECKACTIVITY Open/Close the Activity popup
DOEXPLOREPHOTOSFOLLOW Follow only of the DOEXPLOREPHOTOSFOLLOWLIKE, follow between IFB_ExplorePhotos__FollowMin and IFB_ExplorePhotos__FollowMax post
DOEXPLOREPHOTOSFOLLOWLIKE Follow and Like of the DOEXPLOREPHOTOSFOLLOWLIKE
DOEXPLOREPHOTOSLIKE Like only of the DOEXPLOREPHOTOSFOLLOWLIKE, like between IFB_ExplorePhotos__LikeMin and IFB_ExplorePhotos__LikeMax post
DOFOLLOWBACK Follow back your follower that you are not already following
DOHOMEPAGELIKE Like post in the home screen, like between IFB_HomePage__LikeMin and IFB_HomePage__LikeMax post
DOUNFOLLOWUNFOLLOWERS Unfollow users not following you
LOOP Restart from first task (or BEGINLOOP if present), loop for IFB_TaskManager__LoopTaskLimit times
SAVE Save the user session file, including cookie, allowing session to be resumed next application launch
WAIT Pause the worker

instagramfollowerbot's People

Contributors

smf33 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

instagramfollowerbot's Issues

ENDED IN ERROR : element click intercepted

Hi ! It's me again. As your flickr tool is great, I wanted to try the Instagram one.

It crashes with this error :

## ENDED IN ERROR : element click intercepted: Element <a class="gmFkV" href="/.../" tabindex="0">thibautflt</a> is not clickable at point (1067, 125). Other element would receive the click: <div class="RnEpo Yx5HN " role="presentation">...</div> (Session info: chrome=87.0.4280.66) OpenQA.Selenium.ElementClickInterceptedException: element click intercepted: Element <a class="gmFkV" href="/.../" tabindex="0">thibautflt</a> is not clickable at point (1067, 125). Other element would receive the click: <div class="RnEpo Yx5HN " role="presentation">...</div> (Session info: chrome=87.0.4280.66) at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary 2 parameters) at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary 2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.Execute(String commandToExecute, Dictionary 2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.Click() at InstagramFollowerBot.SeleniumWrapper.Click(String cssSelector) in /home/thibaut/web/InstagramFollowerBot/SeleniumWrapper.cs:line 142 at InstagramFollowerBot.FollowerBot.AuthLogin() in /home/thibaut/web/InstagramFollowerBot/FollowerBot.Actions.cs:line 213 at InstagramFollowerBot.FollowerBot.Run() in /home/thibaut/web/InstagramFollowerBot/FollowerBot.cs:line 68 at InstagramFollowerBot.Program.Main(String[] args) in /home/thibaut/web/InstagramFollowerBot/Program.cs:line 18

using dotnet run, and the same using docker-compose up :

bot_1 | ## ENDED IN ERROR : element click intercepted: Element <a class="gmFkV" href="/.../" tabindex="0">thibautflt</a> is not clickable at point (977, 125). Other element would receive the click: <div class="RnEpo Yx5HN " role="presentation">...</div> bot_1 | (Session info: chrome=87.0.4280.66) bot_1 | OpenQA.Selenium.ElementClickInterceptedException: element click intercepted: Element <a class="gmFkV" href="/.../" tabindex="0">thibautflt</a> is not clickable at point (977, 125). Other element would receive the click: <div class="RnEpo Yx5HN " role="presentation">...</div> bot_1 | (Session info: chrome=87.0.4280.66) bot_1 | at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) bot_1 | at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary 2 parameters) bot_1 | at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary 2 parameters) bot_1 | at OpenQA.Selenium.Remote.RemoteWebElement.Execute(String commandToExecute, Dictionary 2 parameters) bot_1 | at OpenQA.Selenium.Remote.RemoteWebElement.Click() bot_1 | at InstagramFollowerBot.SeleniumWrapper.Click(String cssSelector) in /src/SeleniumWrapper.cs:line 144 bot_1 | at InstagramFollowerBot.FollowerBot.AuthLogin() in /src/FollowerBot.Actions.cs:line 214 bot_1 | at InstagramFollowerBot.FollowerBot.Run() in /src/FollowerBot.cs:line 70 bot_1 | at InstagramFollowerBot.Program.Main(String[] args) in /src/Program.cs:line 18 instagramfollowerbot_bot_1 exited with code 255

I don't know if it can help, but the coordinates of the not clickable point are not the same each time I test. I am using the last stable version of chrome on Arch Linux. Thank you ! :)

Chrome 88 Errors

I'm a novice with no programming knowledge at all.

I was able to get the FlickrFollowerBot to run successfully.

But I'm having trouble getting the InstagramFollowerBot to run?

Here's the error I get:

dotnet : [1613251685.458][WARNING]: This version of ChromeDriver has not been tested with Chrome version 88.
At line:1 char:1

  • dotnet run IFB_TaskManager__TaskList=DetectContactsUnfollowBack,DoCon ...
  •   + CategoryInfo          : NotSpecified: ([1613251685.458...ome version 88.:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.