Skip to content
forked from alexal1/Insomniac

Instagram bot for automated Instagram interaction using Android device via ADB

Notifications You must be signed in to change notification settings

Rob192/Insomniac

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Insomniac

Insomniac

GitHub tag (latest by date) Python PRs Welcome

español | português

Liking and following automatically on your Android phone/tablet. No root required: it works on UI Automator, which is an official Android UI testing framework.

How to install

  1. Clone project: git clone https://github.com/alexal1/Insomniac.git
  2. Go to Insomniac folder: cd Insomniac
  3. Install required libraries: pip3 install -r requirements.txt
  4. Download and unzip Android platform tools, move them to a directory where you won't delete them accidentally, e.g.
mkdir -p ~/Library/Android/sdk
mv <path-to-downloads>/platform-tools/ ~/Library/Android/sdk
  1. Add platform-tools path to the PATH environment variable. If you do it correctly, terminal / command prompt command adb devices will print List of devices attached

How to install on Raspberry Pi OS

  1. Update apt-get: sudo apt-get update
  2. Install ADB and Fastboot: sudo apt-get install -y android-tools-adb android-tools-fastboot
  3. Clone project: git clone https://github.com/alexal1/Insomniac.git
  4. Go to Insomniac folder: cd Insomniac
  5. Install required libraries: pip3 install -r requirements.txt

Get started

  1. Connect Android device to your computer with a USB cable
  2. Enable Developer options on the device

On Android 4.1 and lower, the Developer options screen is available by default. On Android 4.2 and higher, you must enable this screen. To enable developer options, tap the Build Number option 7 times. You can find this option in one of the following locations, depending on your Android version:

Android 9 (API level 28) and higher: Settings > About Phone > Build Number

Android 8.0.0 (API level 26) and Android 8.1.0 (API level 26): Settings > System > About Phone > Build Number

Android 7.1 (API level 25) and lower: Settings > About Phone > Build Number

  1. Switch on USB debugging (and Install apps via USB if there is such option) on the Developer options screen.
  2. Device will ask you to allow computer connection. Press "Connect"
  3. Type adb devices in terminal. It will display attached devices. There should be exactly one device. Then run the script (it works on Python 3):
cd <path-to-project>/Insomniac
python3 insomniac.py --interact <username1> <username2> ...

Make sure that the screen is turned on and device is unblocked. You don't have to open Instagram app, script opens it and closes when it's finished. Just make sure that Instagram app is installed. If everything's fine, script will open each blogger's followers and like their posts.

Usage

Full list of command line arguments:

  --interact username1 [username2 ...]
                        list of usernames with whose followers you want to
                        interact
  --likes-count 2-4     number of likes for each interacted user, 2 by
                        default. It can be a number (e.g. 2) or a range (e.g.
                        2-4)
  --total-likes-limit 300
                        limit on total amount of likes during the session, 300
                        by default
  --interactions-count 60-80
                        number of interactions per each blogger, 70 by
                        default. It can be a number (e.g. 70) or a range (e.g.
                        60-80). Only successful interactions count
  --repeat 120-180      repeat the same session again after N minutes after
                        completion, disabled by default. It can be a number of
                        minutes (e.g. 180) or a range (e.g. 120-180)
  --follow-percentage 50
                        follow given percentage of interacted users, 0 by
                        default
  --follow-limit 50     limit on amount of follows during interaction with
                        each one user's followers, disabled by default
  --unfollow 100-200    unfollow at most given number of users. Only users
                        followed by this script will be unfollowed. The order
                        is from oldest to newest followings. It can be a
                        number (e.g. 100) or a range (e.g. 100-200)
  --unfollow-non-followers 100-200
                        unfollow at most given number of users, that don't
                        follow you back. Only users followed by this script
                        will be unfollowed. The order is from oldest to newest
                        followings. It can be a number (e.g. 100) or a range
                        (e.g. 100-200)
  --unfollow-any 100-200
                        unfollow at most given number of users. The order is
                        from oldest to newest followings. It can be a number
                        (e.g. 100) or a range (e.g. 100-200)
  --min-following 100   minimum amount of followings, after reaching this
                        amount unfollow stops
  --device 2443de990e017ece
                        device identifier. Should be used only when multiple
                        devices are connected at once
  --old                 add this flag to use an old version of uiautomator.
                        Use it only if you experience problems with the
                        default version

FAQ

Analytics

There also is an analytics tool for this bot. It is a script that builds a report in PDF format. The report contains account's followers growth graphs for different periods. Liking, following and unfollowing actions' amounts are on the same axis to determine bot effectiveness. The report also contains stats of sessions length for different configurations that you've used. All data is taken from sessions.json file that's generated during bot's execution.

To get access to the analytics tool you have to join Patreon $10 tier.

Features in progress

  • Follow given percentage of interacted users by --follow-percentage 50
  • Unfollow given number of users (only those who were followed by the script) by --unfollow 100
  • Unfollow given number of non-followers (only those who were followed by the script) by --unfollow-non-followers 100
  • Support intervals for likes and interactions count like --likes-count 2-3
  • Add random actions to behave more like a human (watch your own feed, stories, etc.)
  • Interaction by hashtags
  • Commenting during interaction

Why Insomniac?

There already is InstaPy, which works on Instagram web version. Unfortunately, Instagram bots detection system has become very suspicious to browser actions. Now InstaPy and similar scripts work at most an hour, then Instagram blocks possibility to do any actions, and if you continue using InstaPy, it may ban your account.

That's why need arised in a solution for mobile devices. Instagram can't distinguish bot from a human when it comes to your phone. However, even a human can reach limits when using the app, so don't fail to be careful. Always set --total-likes-limit to 300 or less. Also it's better to use --repeat to act periodically for 2-3 hours, because Instagram keeps track of how long the app works.

Community

We have a Discord server which is the most convenient place to discuss all bugs, new features, Instagram limits, etc. If you're not familiar with Discord, you can also join our Telegram chat. And finally, all useful info is posted on our Patreon page. Most posts are available for everyone, but some require joining $10 tier: this is our way to keep evolving and improving the bot.

Discord Server Telegram Chat Patreon Page

About

Instagram bot for automated Instagram interaction using Android device via ADB

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%