Git Product home page Git Product logo

gramaddict / bot Goto Github PK

View Code? Open in Web Editor NEW
888.0 34.0 147.0 7.41 MB

Completely free and open-source human-like Instagram bot. Powered by UIAutomator2 and compatible with basically any Android device 5.0+ that can run Instagram - real or emulated.

Home Page: https://docs.gramaddict.org

License: MIT License

Python 100.00%
android automation followers like bot interaction automatic automator instagram instagram-bot

bot's Introduction

logo

GramAddict


Looking for Instagram automation? I'm proud to present you a 100% free and open source Instagram bot. This bot will allow you to grow your following and engagement by liking, following, commenting and sending PM automatically with your Android phone/tablet/emulator. No root required.


Why should I automate my Instagram account?

It's very hard nowadays to grow an account. Have you ever been on the explore page? IG will show your post only to close accounts & accounts you interact most with, you will never be on the explore page. Nobody will see your beautiful photos, your hilarious memes, or whatever you are posting. But now you can do something about that! With GramAddict you can get noticed easily, and if you really deserve it, your account will grow super fast!

So, do I need to publish good content to grow?

Of course you have to! This bot will mainly help you to get the visibility you deserve and which is Instagram not giving you.

Ok but I don't know how to start this journey...

Don't worry about that now, it's not that hard to start botting with GramAddict! I tried to make it as noob-friendly as possible. In any case, if you follow the docs with all the steps provided, you will make it! You are also invited to join our community and ask for any help!

There is a community around this project?

Yes! We are on discord and we count a lot of active users you can ask us whatever you want!

I saw there are a lot of similar projects on GitHub, why should I choose this one?

You're right, there are plenty of other bot solutions. Most of them use API requests. However, you will get your account banned if you use API (1-30 days)! There's also a very similar project to this one, yet it's not free and the dev doesn't care about the community much. They removed few lines from the core and ask you for a subscription plan in order to use those features. Furthermore, you don't even know what's the real code during execution - it's encrypted. And if they are stealing something else? Who knows? I don't. This bot is free to use and open source, you won't get charged for few extra lines, EVER. I'm focused on the community and not on finding ways how to get money out of this project. I really care about the community and every dev should too. ๐Ÿค—

So this bot does not use API?

No this bot is working through adb and is powered by uiautomator2 which is a testing wrapper for Android devices. In fact, your device (or an emulator) is used for doing the botting sh*it. That's very secure compared to other botting systems around there. I also made it look as much human as possible. You can think about the bot as a stupid friend using your phone and doing things for you. The example bottom is quite old but will show you what we are talking about.

Urra! I'll never get banned anymore with this bot!

No no no, wait! ๐Ÿคฆ You have to configure the bot for doing things as a human would do. Do you really spend all the day scrolling on Instagram? If yes contact a medic :P You don't have to do so many actions or Instagram will block you. That appends even if you do that by your hands.. Have you ever added a lot of people in a row and got blocked for that action? Or spamming people with a link in PM? DON'T F*CKING DO THAT

Be gently and anonymous and nobody will notice that you're botting, trust me.

Do I need a computer for running the bot?

Yes, but you can also run it directly on your phone!!

In any case, you can decide to use a physical device or an emulator. If you're under Windows I suggest you use Memu, under Mac OS we found out that Android studio works well (Installable with homebrew). For hosting the bot you can use:

  • your computer (with Windows, macOS, or Linux)
  • a Raspberry (which is a cheap little pc Linux based)

Cool! What can I do with this bot?

There are lots of cool features you can use for free!

  • Works without rooting

  • Works with both emulators and physical devices

  • Can be used stand-alone (without the use of a computer)

  • Includes realistic random human-like delays and actions

  • Can watch stories while interacting

  • Comment post with emojis and spintax logic

  • Send PM

  • Type like a human (letter by letter by faking using suggestions. For example, you won't type H - e - l - l - o letter by letter but something like H - He - Hello)

  • Browse carousels and watch their contents

  • Watch videos for a specific amount of time

  • Scheduler

  • Getting tasty telegram reports

  • Supports multiple actions in one session

  • Lots of customizable limits to keep your account safe from soft bans

  • Available interactions

    • interact with a user's followers or following
    • interact with a top or recent hashtag's post likers
    • interact with a top or recent hashtag post
    • interact with a top or recent place's post likers
    • interact with a top or recent place post
    • interact with user's post likers
    • interact with a single blogger
    • interact with your feed
    • interact with users from a list (*.txt)
    • interact with posts from links inside a list (*.txt)
    • unfollow any followers
    • unfollow any followers, followed by bot
    • unfollow any followers, followed by bot, who don't follow you back
    • unfollow from a list (*.txt)
    • scrape mode for collecting usernames instead of interacting with them (you will find more information about that in the doc)
  • Lots of available filters to customize who you interact with

    • you can blacklist people to avoid interacting with them
    • you can whitelist people to not remove them when you unfollow people
    • biography main characters and language
    • profile name main characters
    • private / public / business / non business account
    • number of posts / followers / following ... and more!

Full documentation available on docs.gramaddict.org

Telegram reports? What's that?

You can get reports through telegram from your bot activities! Follow this guide to accomplish that.

In this case trends are negative because I use this account only for tuning this bot, and it's private... I didn't accept anyone lately so the trends are meh :P

Cool, isn't it? ๐Ÿ’ฆ

Quick start

Now that you're there you still don't know how to install that whole thing. I'll try to help you accomplish that with a short tutorial. The full is available here.

What do you need:

  • a computer (with Windows, macOS or Linux)
  • Python installed on your machine (with pip)
  • Adb tools
  • a physical device or an emulator (with Android 4.4+)

Step 1: Install Python (>=3.6):

Python 3.10 is currently not supported!

If you're on Linux or macOS you should have Python and Git installed, just check that your Python version is >= 3.6.

On Windows you have to install it for sure.

Failed? Detailed tutorial here.

A little reminder: we refer to python with python3. You may also have python2 installed if you're on Linux for example. If you're on Windows you can use python instead of python3. Check which python alias you have to use by typing python -V or python3 -V or py -V and use the right one for the rest of the tutorial.

Check that pip3 is installed by typing pip3 -V If that returns an error you have to install it! How? Google is your best friend! :P

Step 2: Install GramAddict:

You can install GramAddict in two ways: with pip or with git. Is good practice creating virtual environments when you install a new package. That will save you from a lot of problems!

Create a virtual environment

We create a virtual environment called .venv and activate it:

  • create a directory where you will create the new environment
  • write in console: python3 -m venv .venv

    We use venv instead of virtualenv because venv is shipped directly with python3 and you don't have to install anything ๐Ÿคช

  • activate the .venv:
    • source .venv/bin/activate on Linux/macOS
    • .venv\Scripts\activate.bat on Windows cmd
    • .venv\Scripts\activate.ps1 on Windows PowerShell

      If you activate the venv correctly, you will see a little (.venv) on the left side of the command line!

With pip (I suggest you this way):

  • install the package: pip3 install GramAddict
  • check if it's installed: gramaddict --version
  • if everything is fine you will get the GramAddict version installed ๐Ÿฅณ

With git:

Warning: console commands like gramaddict init, gramaddict dump and gramaddict run won't work if you installed the bot with git.

  • clone the project: git clone https://github.com/GramAddict/bot.git gramaddict
  • enter the gramaddict folder: cd gramaddict
  • install the requirements: pip3 install -r requirements.txt

Step 3: Install adb:

Adb stands for Android Debug Bridge. It's needed for making this bot working properly. I think this one is the hardest part to accomplish but don't give up! You can do it, with my help. ๐Ÿ’ช

  1. download this package and unzip it somewhere and remind the path

    Warning: place that where you're sure you won't ever delete it, otherwise the bot won't work anymore!

  2. add platform-tools path to the PATH environment variable
    • if you're on Linux/macOS that's pretty easy:
      • open ~/.bash_profile with any text editor you like
      • add the following line with the full path to the platform-tools directory: export PATH=~/Library/Android/sdk/platform-tools/:$PATH. This path may be different depending on the way you installed platform-tools
      • save file and restart Terminal
    • on Windows there are more steps to accomplish that:
      • open Windows Explorer (you can press WINKEY+E) and right-click "My Computer" on left side
      • in the pop-up menu, click Properties
      • in the System Properties window, click the Advanced tab, and then click Environment Variables
      • in the System Variables window, highlight Path, and click Edit
      • in the Edit System Variables window, press on New
      • enter the full path for the folder platform-tools you unzipped before
      • press all the Ok and restart Command Prompt
  3. check that everything is fine
    • write adb version, you should get something like that:

      C:\Users\dedil>adb version Android Debug Bridge version 1.0.41 Version 30.0.5-6877874

Step 4: Set up the device:

Physical device

  1. First thing you have to do is to enable developer options and USB debugging.
  2. connect your phone to your computer with a USB cable
  3. device will ask you to allow connection. Press "Connect"

Emulator for Mac OS

  1. Install the Homebrew
  2. Install the Cask by running brew install cask
  3. Add the Cask application folder to your $PATH, e.g. echo 'export PATH="$HOME/.cask/bin:$PATH"' >> ~/.bash_profile and open a new terminal or reload with source ~/.bash_profile
  4. Install the Android Studio
  5. Run the Android Studio and click on 'More Actions -> Virtual Device Manager', then select the device and image, I found out that Pixel 2 API 28 combo works well.
  6. Run the virtual device and install the Instagram app on it, don't forget to log in.

Verify the device with adb

Type adb devices in terminal

  • a list of devices attached should be displayed, if not you did something wrong

    List of devices attached A0B1CD2345678901 device

  • this is your device ID, you have to use it only if you have more than one device connected at the same time

Step 5: Start the bot:

This bot works only if your Instagram is in English.

  1. initialize uiautomator2: uiautomator2 init
  2. initialize GramAddict: gramaddict init your_ig_account_name_here

    Warning: works only if you installed the bot with pip, if you used git you have to create account folder and youraccountname folder manually.

    • that script will crate all the files you need for configure and start this bot
    • you will find them inside the folder accounts/youraccountname/
        gramaddict/
          run.py
          accounts/
            youraccountname/
              config.yml
              telegram.yml
              filters.yml
              whitelist.txt
              blacklist.txt
              comments_list.txt
              pm_list.txt
  3. now that you have all the requirements you have to configure the whole thing by following this guide
  4. now you're done, and you can finally start the bot: python3 run.py --config accounts/yourusername/config.yml or gramaddict run --config accounts/yourusername/config.yml

Failed? Check this out!

Bot crashes, what should I do?

The script isn't perfect and may fail sometimes. If this is the case you can open a ticket on our discord channel. In that way you won't share with anyone your Instagram account name ๐Ÿ˜ˆ. We'll be very happy to help you!

WOW! You dedicated so much time to this project! Why you did that for free??

Well, we used to be in three a long time ago but suddenly my two friends left. This has been an opportunity for me to improve my skills in Python and that's why I didn't leave the project and keep maintaining it. But of course donations are very welcome, so if you think I did a great job you can buy me a beer :)

Buy Me A Coffee

Can I do something to make this project grown?

On GitHub there is a star system which indicates how good a project is. If you like this project it will be amazing if you can press the little star at the top! โญ

Contributors

This project exists thanks to all of our Contributors [Contribute].


Backers

Thank you to everyone that supports us financially! ๐Ÿ™ [Become a backer]


Talk botty with us

Join us on Discord


Disclaimer: This project comes with no guarantee or warranty. You are responsible for whatever happens from using this project. It is possible to get soft or hard banned by using this project if you are not careful.

bot's People

Contributors

alexal1 avatar alexowson avatar arthurspa avatar dependabot[bot] avatar dnush avatar dredozubov avatar foncekar avatar gvmturl avatar henriqueturl avatar mastrolube avatar patbengr avatar philip-ulrich avatar ugurkellecioglu avatar

Stargazers

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

Watchers

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

bot's Issues

ERROR: Could not find like button below the post

What happened: Once the script is running, for each profile visited it throws back an "ERROR: Could not find like button below the post. then WARNING: Fail to like post. Let's continue..."

Please see screenshot:
https://i.imgur.com/viw5guO.jpg

It says "Could not like photo". But, it likes the photo and goes to the next profile anyway.

What you expected to happen:

How to reproduce it (as minimally and precisely as possible): To reproduce the error/warning just run the script.

Anything else we need to know?: This is version number 1.1.1

Environment:

  • GramAddict version: 1.1.1
  • Device Model/Emulator Type: Huawei Mate 8 Pro
  • Android Version: 7.0
  • Instagram Version: 167.0.0.24.120
  • Discord Ticket ID: wordbyte *(if submitting crash log)

Relevant Logs:




*Note: if you have a crash log, please do not attach the archive here as this is not a secure place to upload the sensitive data inside. Please open a ticket in Discord in #lobby and provide the ticket ID here.

TypeError: '<' not supported between instances of 'NoneType' and 'int'

Idk why i got that error

Crash-2020-11-18-22-41-39.zip
Here is the logs. i cut unnecessary parts.

and also here is the last call

File "C:\Users\ugurk\OneDrive\Belgeler\GitHub\gramaddict\GramAddict\core\filter.py", line 94, in check_profile
   if field_min_followers is not None and followers < int(field_min_followers):

TypeError: '<' not supported between instances of 'NoneType' and 'int'

btw i use some utilizations which couldn't merged but i think it is not about that. It was working for 2 hour if it is important.

Specify a list of usernames to ignore

What would you like to be added: completely ignore liking images and follows from certain users

Why is this needed: if you have a business, you don't want to interact with the competition

Add error handling to analytics

Particularly:

  • Check if follower count is missing or None.
  • Check if profile exists or not

Maybe while we are in there; clean up the code in general.

What is GramAddict?

Introduction

The original insomniac project has gone closed source and paid. Along with that, a new feature as well as some old ones have been locked behind a paywall. Some might say this is the natural progression of software - and you may be right in some cases. The main issue was that people like myself were actively contributing to the project and 1) Now cannot 2) Would be profited off of with no benefit to ourselves. IMO, the more FOSS software the better and I originally contributed thinking this would remain open source like it was. This project is an attempt to fork this into a new and actual FOSS project that developers can continue to contribute to.

Funding

All great projects eventually grow to where they require multiple people owning it or a source of funding. When you start open source and let people contribute, typically people who already did contribute, who tried to contribute, or who were planning on contribute feel slighted when the project goes closed source. As long as I am alive and kicking, this fork of the original will NEVER go closed source. If we ever determine that we need funding - it will be voluntary and/or done in a way that the source is still available and the people developing the project will still be able to work and hack on the source... even to the point of unlocking features otherwise "locked" behind the paywall. To be clear though, I would like to avoid any type of funding aside from voluntary donations.

What's next

It sounds like there are others that are in the boat for forking, so let's come together and discuss this. Maybe we start up our own discord server to help facilitate the discussion. Probably best to stick to this GH issue for now. I'd like another experienced Python developer to co-own this project with me (in terms of GH ownership) and we'd put it in it's own proper org so it's not under any one persons name. We also need to do all the TODO below plus more. Let me know if you are interested in being a co-owner of the GH repository or if you plan to contribute below.

TODO

  • Rebase to v2
  • Give it a new name! Because we can't live off of the old one.
  • Find contributors! If you're reading this, that means you!
  • reuse whatever bugfixes that were made since then - if they are even in the source now
  • update the README.md file
  • Implement a contributing guidelines and a proper ci/cd process so everyone keeps their sanity.
  • Figure out distribution - admittedly going to pip was a good move. Encrypting the source files not so much.
  • Other stuff... like the new features and bugfixes. ๐Ÿ˜ƒ

New Plug-in: --hashtag-posts

What would you like to be added: interact to post owners in recent hashtag view

Why is this needed: some people would be interested to interact with these users to grow up their visibility / create collaborations with them

specify to run during specific hours of the day

What would you like to be added:

being able to specify in which hours account can run in , or at least specify how many sessions per day ? either way it works for my needs

Why is this needed:

because it does not make sense for an account to run 24/7 , people do sleep.. etc.. doing this would make the bot behaviour to look more human

limit actions per day

What would you like to be added:
it would be nice if we can specify the max number of follows/likes per day , and when that limit has been reached basically just quit the script

Why is this needed:

because IG has a daily limit per day that if we go overboard then account would get temp blocked, i know right now there is a way to specify repeat x-y minutes

Allow verbose log in console

Currently it does not print debug logs to
the console, only crash report. We should allow by passing
a flag as argument for more verbose log.

It helps when testing.

Build docker image

What would you like to be added:

A Dockerfile to use the bot with docker for users who want it

Why is this needed:

Simple and fast way to use the bot on multiple platforms.
Personally I use this one with the Mangata launch script

Dockerfile.zip

Config files

The parameters are getting INSANE

What would you like to be added:

  • per username config files - should be in the same folder as the data
  • per username filters - should be in the same folder as the data

Why is this needed:
I'm not going to explain to myself why I am going to code this, but really it's pretty obvious.

Send direct and share post

Hey, I just started to use your library and am loving it. I currently have a selenium bot that I use to send directs and posts to targets.

It would be great to have it implemented in your android tool because of all the IG bot suspicion limits on browsers and etc.

Thanks again for your work!

Raise Exception on username not found or at least handle it better

I think we should raise an exception on this issue and not let the user continue. The reason being that it's not tracking any of the actions done and it leads to bad situations where users may have been followed by the script, but not tracked. Forcing a user to "unfollow any" in order to remove them - or do it manually. I can't think of any valid reasons why we would continue if we can't get their username.

If we do want to continue, we should at least safe it to an "undefined" user or something so that data isn't lost.

Ref: https://github.com/GramAddict/bot/blob/master/GramAddict/core/storage.py#L27

Thoughts?

Sugestion: increase available data in interacted_users.json

What would you like to be added:
As of now, the interacted_users.json contain two fields for each user: "last_interaction" and "following_status". It would be nice to add a field for each action:

  • Liked (int field, number of liked posts),
  • Followed (binary, did the bot follow this user?),
  • Unfollowed (binary, did the bot unfollow this user?)
  • Private, (binary, if the user is private)
  • blogger (string, wich blogger were you targeting when you interacted with this user)

Why is this needed:

  • I would like to calculate conversion rates later. For this, I would need to exclude private users that the bot didnt like and calculate how many of the liked users followed me. It would be also interesting to measure if liking more pics increases the conversion to follower rate.

I hope this is not hard to include in the jsons.

update all (appropriate) arguments to support ranges

What would you like to be added:
Needs to be done for every plugin - maybe should be done before the plugins so we don't have to do the calculation in the plugin? Or do we want it to be extra random?

Why is this needed:
For randomness.

Allow per-user filters

What would you like to be added:
Per user filters

Why is this needed:
so you can filter per user - look in the folder for the user where the session data is stored. username/filter.py

Bot restart after this error

What happened: Bot throws error posted in logs below and restart. Happens multiple times during session

What you expected to happen: To complete session without errors

How to reproduce it (as minimally and precisely as possible): Seems it occur randomly

Anything else we need to know?: Sometimes when bot likes photo it scrolls down and unlike the same one

Environment:

  • GramAddict version: 1.1.1
  • Device Model/Emulator Type: Nexus 6
  • Android Version: 8.1.0
  • Instagram Version: 167.1.0.25.120
  • Discord Ticket ID: *(if submitting crash log)

Relevant Logs:

ERROR | Traceback (most recent call last):
File "/home/pi/bot-1.1.1/GramAddict/core/device_facade.py", line 299, in get_bounds
return self.viewV2.info["bounds"]
File "", line 2, in info
File "/home/pi/.local/lib/python3.7/site-packages/retry/api.py", line 74, in retry_decorator
logger)
File "/home/pi/.local/lib/python3.7/site-packages/retry/api.py", line 33, in __retry_internal
return f()
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/_selector.py", line 130, in info
return self.jsonrpc.objInfo(self.selector)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 435, in call
http_timeout)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 441, in _jsonrpc_retry_call
return self._jsonrpc_call(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/uiautomator2/init.py", line 513, in _jsonrpc_call
raise err
uiautomator2.exceptions.UiObjectNotFoundError: -32001 Jsonrpc error: <android.support.test.uiautomator.UiObjectNotFoundException> data: UiSelector[RESOURCE_ID_REGEX=com.instagram.android:id/profile_tabs_contain
er], method: objInfo

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/bot-1.1.1/GramAddict/core/decorators.py", line 29, in wrapper
func(*args, **kwargs)
File "/home/pi/bot-1.1.1/GramAddict/plugins/interact_blogger_followers.py", line 129, in job
on_interaction,
File "/home/pi/bot-1.1.1/GramAddict/plugins/interact_blogger_followers.py", line 189, in handle_blogger
is_myself,
File "/home/pi/bot-1.1.1/GramAddict/plugins/interact_blogger_followers.py", line 313, in iterate_over_followers
device, username=username, can_follow=can_follow
File "/home/pi/bot-1.1.1/GramAddict/core/interaction.py", line 83, in interact_with_user
ProfileView(device).swipe_to_fit_posts()
File "/home/pi/bot-1.1.1/GramAddict/core/views.py", line 853, in swipe_to_fit_posts
resourceIdMatches="com.instagram.android:id/profile_tabs_container"
File "/home/pi/bot-1.1.1/GramAddict/core/device_facade.py", line 301, in get_bounds
raise DeviceFacade.JsonRpcError(e)
GramAddict.core.device_facade.DeviceFacade.JsonRpcError: -32001 Jsonrpc error: <android.support.test.uiautomator.UiObjectNotFoundException> data: UiSelector[RESOURCE_ID_REGEX=com.instagram.android:id/profile_ta
bs_container], method: objInfo




*Note: if you have a crash log, please do not attach the archive here as this is not a secure place to upload the sensitive data inside. Please open a ticket in Discord in #lobby and provide the ticket ID here.

Make this repo easier to discover

I only found this through someone dm'ing me on discord. Insomoniac pops up pretty easily if you search for adb based instagram bots but this one is almost invisible. I think it would help if we invest some effort into making this easier to discover and find, so we can 1) get more users 2) get more people contributing.

A few easy ways to do this is 1) add tags 2) add description 3) post on InstaPy issues (similar to Insomniac)

Better Random Sleep

What would you like to be added:

  • Accept a range for random sleep
  • Make default shorter time unless needed
  • Add parameter to "speed" it up

Why is this needed:

  • Certain people are saying it's too slow or something. It's a feature, but some can't appreciate it.

min_posts filter is not working?

Hello!
I cant find occurence of "min_posts" in project code. This filter is not working?
Sometimes i can see, that bot tries to like post in, for example, 3rd column-1st row. But profile have only 1 post and i have filter for minimum of 7 posts.

If Instagram Crashes, reopen it

What would you like to be added:
Reopen instagram if it crashes

Why is this needed:
Sometimes is closes at open with the current version. Handle that gracefully as well as mid-action. The latter probably done in the decorator.

Add all parameters to logging

Add all parameters to logging so we can see what parameters were run in the crash log. Once we switch to config files, we need to log those instead/as well.

scrolls limit argument

What would you like to be added:

  • provide an argument to limit how many "failed" scrolls are done before you move to the next source

Why is this needed:

  • if you go too deep in the followers (and also kinda likes) you are getting stale data. It's better to move onto the next post than waste time scrolling.

unexpected keyword argument 'capture_output' on startup

Hey. First of all: many thanks for the effort to keep software free and open source โค๏ธ

In contrast to insomniac I have an issue on startup the app and I can't find the point to fix it:

(.venv) โžœ  bot git:(master) python3 run.py --blogger-followers kwerfeldein --device ce01171159e094490c
[11/22 15:33:06]     INFO | GramAddict 1.0.4
[11/22 15:33:06]     INFO | Loading plugins . . .
[11/22 15:33:06]     INFO |   - ActionUnfollowFollowers: This plugin handles the functionality of unfollowing your followers
[11/22 15:33:06]     INFO |   - CoreArguments: This plugin simply adds core arguments
[11/22 15:33:08]     INFO |   - DataAnalytics: Generates a PDF analytics report of specified username session data
[11/22 15:33:08]     INFO |   - InteractBloggerFollowers: This plugin handles the functionality of interacting with a bloggers followers
[11/22 15:33:08]     INFO |   - InteractHashtagLikers: This plugin handles the functionality of interacting with a bloggers followers
[11/22 15:33:08]     INFO | Instagram version: not found
[11/22 15:33:08]     INFO | -------- START: 2020-11-22 15:33:08.220735 --------
[11/22 15:33:08]     INFO | Open Instagram app
Traceback (most recent call last):
  File "run.py", line 3, in <module>
    GramAddict.run()
  File "/home/julian/d/bot/GramAddict/__init__.py", line 154, in run
    open_instagram(device_id)
  File "/home/julian/d/bot/GramAddict/core/utils.py", line 80, in open_instagram
    cmd_res = subprocess.run(cmd, capture_output=True, shell=True, encoding="utf8")
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
TypeError: __init__() got an unexpected keyword argument 'capture_output'

When I list the connected devices, it shows me my phone

(.venv) โžœ  bot git:(master) adb devices                                                               
List of devices attached
ce01171159e094490c	device

The screen is active when I start the script. The dependencies are installed.

Can anyone give me a hint how to solve it?

specify a list of usernames to interact with

What would you like to be added:
being able to specify a targets.txt with a list of pre-filtered usernames that we interact with

Why is this needed:
because going to the account one by one and checking it against the filter is such a waste of time and data bandwidth, there are lots of tools out there to scrape and filter instagram and it's better if we do it that way

User agent/Request header when used from Emulator

I want to ask about if Instagram will be able to detect that the traffic is coming from an emulator ? what will be the user agent and request header information sent to Instagram endpoints when using emulator ?

What about a real device will there be any difference between manually liking/commenting or using the automation ?

Profile header values not showing

I've had GramAddict running for a couple of hours a day for some days now. Today, suddenly the "Posts", "Followers" and "Following" counts on the header of profiles stopped showing up.

Resources row_profile_header_textview_followers_count and row_profile_header_textview_following_count just aren't there.

Screenshot:
image

I'ts happening on both emulator and physical device, but only with the account I've been using with GramAddict.

This of course makes followings_text_view.get_text() and followers_text_view.get_text() return nothing, and in turn messes up the filtering, so in my case for example, the bot skipped all interactions as None is less than the field_min_followers I had set.

Could this be an anti botting measure? Has anyone else experienced this?

If this really is some desperate alternative to rate-limiting, how do you propose GramAddict should handle it? Fall back to not using follower/following count and just interacting indiscriminately?

Curious to hear your take on this.

Targets list support

Targets list support is crucial for all those looking for more precise targeting . This feature seems to already be part of the Imsoniac bot but wasn't added to GramAddict .

Why is this needed:

Many people already have lists of targets that they have previously scraped and they don't want to be dependent on the random interactions of a bot .

example : Previously scraping comments and likes from a list of posts and making direct interactions on those user profiles

Expecting Delimiter

What happened:
Traceback (most recent call last): File "C:\bot-master\run.py", line 3, in <module> GramAddict.run() File "C:\bot-master\GramAddict\__init__.py", line 233, in run storage = Storage(session_state.my_username) File "C:\bot-master\GramAddict\core\storage.py", line 35, in __init__ self.interacted_users = json.load(json_file) File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 293, in load return loads(fp.read(), File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ':' delimiter: line 13187 column 27 (char 413321)

What you expected to happen:
Bot working as usual

How to reproduce it (as minimally and precisely as possible):
starting BotScript, which was working an hour ago

Anything else we need to know?:
Nope

Environment:

  • GramAddict version: 1.1.1
  • Device Model/Emulator Type: MEMU
  • Android Version: 7.1
  • Instagram Version: 167.1.0.25.120

Relevant Logs:

Allow to interact with an interractive account once again

What would you like to be added:

An option that allows us to go back to liking a profile after a number of days "X"

Why is this needed:

It is possible that the account with which we interact the first time is not reactive but becomes reactive after a second passage ect

Multi-Step Compatibility

This may be a longer term goal considering all the possibilities this opens, but we should allow the bot to do multiple things in sequence without exiting.

For example, as someone using the bot I would want to be able to go and unfollow people after I followed them. So if I followed 20 people that day, I'd also want to unfollow 20 people. The reason for this being is that if someone looks at socialblade or igblade - you can't tell that I followed or unfollowed people that day. It would be a net gain of zero (because these services are rate limited to basically one update a day).

It won't help with fooling instagram, but it helps from a public relations standpoint.

Interact by usernames txt wont find some users.

What happened: When searching for an username, the bot could'nt find it:
image

But the user existed. The problem is the bot makes the search in this first tab of instagram search. If you add a swipe right or click in the "person" icon, you would find the perfect string correspondence to the user instead of instagram suggestion:

image

After it, the gramaddict bot tries to find the bottom tabs of instagram (Search, home, profile), but as the keyboard wasn't closed, it fails and finally crashes.

Possible fixes in my opinion:

  • Temporary: just click to hide the keyboard and then skip the failed user. If you can tell me the path where the change is needed I can make it in my local installation.
  • Definitive: Try to execute the current process. If it fails, retry the user adding a swipe/click in the "person" icon to get the appropriated correspondence.

What you expected to happen:
The bot to find the user.

How to reproduce it (as minimally and precisely as possible):
You can try it with the username in my print.

Anything else we need to know?:

Environment:

  • GramAddict version: 1.2
  • Device Model/Emulator Type: Galaxy S8
  • Android Version: 8.0.0
  • Instagram Version:
  • Discord Ticket ID: *(if submitting crash log)

Relevant Logs:

[12/22 14:51:08]    DEBUG | Navigate to profile @elaborartes (views.py:300)
[12/22 14:51:09]    DEBUG | Single click (478, 125) (device_facade.py:469)
[12/22 14:51:09]    DEBUG | Close the keyboad (views.py:303)
[12/22 14:51:09]    DEBUG | 1.34s sleep (utils.py:135)
[12/22 14:51:12]    DEBUG | 1.32s sleep (utils.py:135)
[12/22 14:51:19]    ERROR | Cannot find user @elaborartes. (views.py:314)
[12/22 14:51:19]    DEBUG | Navigate to SEARCH (views.py:109)
[12/22 14:51:25]    DEBUG | Didn't find search in the tab bar... (views.py:123)
[12/22 14:51:25]    DEBUG | Navigate to HOME (views.py:109)
[12/22 14:51:31]    ERROR | Didn't find tab HOME in the tab bar... Maybe English language is not set!? (views.py:161)
[12/22 14:51:31]     INFO | Language was changed. We'll have to start from the beginning. (decorators.py:83)
[12/22 14:51:31]    DEBUG | Navigate to PROFILE (views.py:109)
[12/22 14:51:36]    ERROR | Didn't find tab PROFILE in the tab bar... Maybe English language is not set!? (views.py:161)




*Note: if you have a crash log, please do not attach the archive here as this is not a secure place to upload the sensitive data inside. Please open a ticket in Discord in #lobby and provide the ticket ID here.

The program crashes even though connection with cable/wifi works.

It starts and opens the instagram app but before it can do anything else it crashes.

Terminal output:
Traceback (most recent call last):
File "/home/grenademaster666/gramaddict/src/device_facade.py", line 184, in click
self.viewV2.click(UI_TIMEOUT_LONG)
File "/home/grenademaster666/.local/lib/python3.8/site-packages/uiautomator2/_selector.py", line 155, in click
self.session.click(x, y)
File "/home/grenademaster666/.local/lib/python3.8/site-packages/uiautomator2/init.py", line 996, in click
self.jsonrpc.click(x, y)
File "/home/grenademaster666/.local/lib/python3.8/site-packages/uiautomator2/init.py", line 435, in call
return self.server._jsonrpc_retry_call(self.method, params,
File "/home/grenademaster666/.local/lib/python3.8/site-packages/uiautomator2/init.py", line 442, in _jsonrpc_retry_call
return self._jsonrpc_call(*args, **kwargs)
File "/home/grenademaster666/.local/lib/python3.8/site-packages/uiautomator2/init.py", line 514, in _jsonrpc_call
raise err
uiautomator2.exceptions.JSONRPCError: -32001 Jsonrpc error: <java.lang.SecurityException> data: java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission
at android.os.Parcel.createException(Parcel.java:2074)
at android.os.Parcel.readException(Parcel.java:2042)
at android.os.Parcel.readException(Parcel.java:1990)
at android.app.IUiAutomationConnection$Stub$Proxy.injectInputEvent(IUiAutomationConnection.java:471)
at android.app.UiAutomation.injectInputEvent(UiAutomation.java:597)
at com.github.uiautomator.stub.TouchController.injectEventSync(TouchController.java:38)
at com.github.uiautomator.stub.TouchController.touchDown(TouchController.java:47)
at com.github.uiautomator.stub.AutomatorServiceImpl.click(AutomatorServiceImpl.java:206)
at java.lang.reflect.Method.invoke(Native Method)
at com.googlecode.jsonrpc4j.JsonRpcBasicServer.invoke(JsonRpcBasicServer.java:467)
at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleObject(JsonRpcBasicServer.java:352)
at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleJsonNodeRequest(JsonRpcBasicServer.java:283)
at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleRequest(JsonRpcBasicServer.java:251)
at com.github.uiautomator.stub.AutomatorHttpServer.serve(AutomatorHttpServer.java:100)
at fi.iki.elonen.NanoHTTPD.serve(NanoHTTPD.java:2244)
at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
at java.lang.Thread.run(Thread.java:919)
, method: click

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 518, in
main()
File "run.py", line 118, in main
) = get_my_profile_info(device)
File "/home/grenademaster666/gramaddict/src/action_get_my_profile_info.py", line 9, in get_my_profile_info
navigate(device, Tabs.PROFILE)
File "/home/grenademaster666/gramaddict/src/navigation.py", line 24, in navigate
button.click()
File "/home/grenademaster666/gramaddict/src/device_facade.py", line 186, in click
raise DeviceFacade.JsonRpcError(e)
src.device_facade.JsonRpcError: -32001 Jsonrpc error: <java.lang.SecurityException> data: java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission
at android.os.Parcel.createException(Parcel.java:2074)
at android.os.Parcel.readException(Parcel.java:2042)
at android.os.Parcel.readException(Parcel.java:1990)
at android.app.IUiAutomationConnection$Stub$Proxy.injectInputEvent(IUiAutomationConnection.java:471)
at android.app.UiAutomation.injectInputEvent(UiAutomation.java:597)
at com.github.uiautomator.stub.TouchController.injectEventSync(TouchController.java:38)
at com.github.uiautomator.stub.TouchController.touchDown(TouchController.java:47)
at com.github.uiautomator.stub.AutomatorServiceImpl.click(AutomatorServiceImpl.java:206)
at java.lang.reflect.Method.invoke(Native Method)
at com.googlecode.jsonrpc4j.JsonRpcBasicServer.invoke(JsonRpcBasicServer.java:467)
at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleObject(JsonRpcBasicServer.java:352)
at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleJsonNodeRequest(JsonRpcBasicServer.java:283)
at com.googlecode.jsonrpc4j.JsonRpcBasicServer.handleRequest(JsonRpcBasicServer.java:251)
at com.github.uiautomator.stub.AutomatorHttpServer.serve(AutomatorHttpServer.java:100)
at fi.iki.elonen.NanoHTTPD.serve(NanoHTTPD.java:2244)
at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
at java.lang.Thread.run(Thread.java:919)
, method: click

         /////////////                grenademaster666@pop-os 
     /////////////////////            ----------------------- 
  ///////*767////////////////         OS: Pop!_OS 20.04 LTS x86_64 
//////7676767676*//////////////       Host: Nitro AN515-51 V1.13 

/////76767//7676767////////////// Kernel: 5.8.0-7625-generic
/////767676///76767/////////////// Uptime: 23 mins
///////767676///76767.///7676
/////// Packages: 2851 (dpkg), 29 (flatpak),
/////////767676//76767///767676//////// Shell: bash 5.0.17
//////////76767676767////76767///////// Resolution: 1920x1080
///////////76767676//////7676////////// DE: GNOME
////////////,7676,///////767/////////// WM: Mutter
/////////////*7676///////76//////////// WM Theme: Pop
///////////////7676//////////////////// Theme: Sweet-Dark [GTK2/3]
///////////////7676///767//////////// Icons: candy-icons [GTK2/3]
//////////////////////'//////////// Terminal: gnome-terminal
//////.7676767676767676767,////// CPU: Intel i7-7700HQ (8) @ 3.800GHz
/////767676767676767676767///// GPU: Intel HD Graphics 630
/////////////////////////// Memory: 3286MiB / 7841MiB
/////////////////////
/////////////

Tried the same with root but no luck.

UIAutomator2 lets anyone on the network control/view your device!

I discovered something very concerning just now.

When using uiautomator2, which is what GramAddict is based around, it silently installs the application ATX-Agent on your device, which opens a webserver on TCP port 7912, that lets anyone on the network, with ZERO form of authentication, execute code, install apps, exfiltrate private data etc. on your device and view the screen remotely.

As soon as you're running GramAddict, this webserver is started. This is a HUGE security concern, and should be addressed immediately!

Try it yourself:

  1. Find the Wi-Fi IP address of your device:
    adb shell ip route | awk '{print $9}'
    (NOTE: It is trivial for anyone on the same network to discover your device and the running webserver)

  2. Run GramAddict as ususal.

  3. Using another device on the same network, go to http://[PHONE IP]:7912 in your browser.

This is what you're presented with:
image

image

(censored for my privacy)
image

(Not showing the API page, as it exposes too much personal info. You can view its endpoints and capabilities at the ATX Agent page linked above)

This is extremely worrying!

Interact by location

What would you like to be added: Interaction based on location

Why is this needed: To reach more specific people

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.