Package: instabot-py
Instabot.py 🤖 🌟Instabot.pyis an extremely light instagram bot that uses the undocumented Web API. Unlike other bots, Instabot.py doesnotrequire Selenium or a WebDriver. Instead, it interacts with the API over simple HTTP Requests. It runs on most systems, including Raspberry Pi.RequirementsPython v3.6 or greaterPip v18 or greaterQuick Start 🚀Make sure you have Python 3.6 or above installedpython3 --versionOn Windows you might have to usepythonwithout the version (3) suffix. Experienced users should use virtualenv.If your version is below 3.6, we recommend you install the latest Python 3.7 or 3.8Python on WindowsPython on MacPython on Raspberry Raspbian / Debian / UbuntuInstallationFrom PyPi (Stable):python3 -m pip install instabot-pyFrom sources (Bleeding edge):python3 -m pip install git+https://github.com/instabot-py/instabot.pyConfiguration⚙️Runinstabot-py --create-configcommand and a default configuration will be created in your current directory:instabot.config.yml. It should be modified according the needs.
You can also run the bot with a different configuration file using-cflag:instabot-py -c myconfiguration.ymlStart the bot🏁instabot-pyorpython3 -m instabot_pyinstabot-py -c myconfiguration.ymlorpython3 -m instabot_py -c myconfiguration.ymlThe%username%.dbfile contains records of posts the bot has liked, and the users who has been followed/unfollowed.The%username%.sessionfile stores your session with Instagram to avoid re-logins each time you start the bot.Upgrade ⬆️python3 -m pip install instabot-py --no-cache-dir --upgradepip3 install instabot-py --no-cache-dir --upgradeParametersParameterTypeDescriptionDefault valueloginstrYour instagram usernamepasswordstrYour instagram passwordstart_at_hintStart program at the hour0start_at_mintStart program at the min0end_at_hintEnd program at the hour23end_at_mintEnd program at the min59debugintEnable (1) or disable (0) debug mode1databasedictContains the database configuration{"type": "sql", "connection_string": "sqlite:///{{login}}.db"}session_filestrchange the name of session file so to avoid having to login every time. Set False to disable."username.session"user_agentstrCustom User Agent to look like a real browserNonelike_per_dayintDEPRECATED, WILL BE REMOVED SOON, REPLACED BY like_per_runlike_per_runintNumber of photos to like per day (over 1000 may cause throttling)296like_followers_per_runintNumber of your old followers to like their last photo per day (set to 0 to disable)0media_max_likeintMaximum number of likes on photos to like (set to 0 to disable)0media_min_likeintMinimum number of likes on photos to like (set to 0 to disable)0follow_per_dayintDEPRECATED, WILL BE REMOVED SOON, REPLACED BY follow_per_run0follow_per_runintUsers to follow per day156follow_timeintSeconds to wait before unfollowing5 * 60 * 60follow_attemptsintAttempts to make to follow someone10user_min_followintCheck user before following them if they have X minimum of followers. Set 0 to disable0user_max_followintCheck user before following them if they have X maximum of followers. Set 0 to disable0follow_time_enabledboolREMOVED, TO DISBALE Follow_time, just set it to 0--unfollow_per_dayintDEPRECATED, WILL BE REMOVED SOON, REPLACED BY unfollow_per_run0unfollow_per_runintUsers to unfollow per day199unfollow_recent_feedboolIf enabled, will populate database with users from recent feed and unfollow if they meet the conditions. Disable if you only want the bot to unfollow people it has previously followed.Trueunlike_per_dayintDEPRECATED, WILL BE REMOVED SOON, REPLACED BY unlike_per_run0unlike_per_runintNumber of media to unlike that the bot has previously liked. Set to 0 to disable.0time_till_unlikeintHow long to wait after liking media before unliking them.3 * 24 * 60 * 60 (3 days)comments_per_dayintComments to post per day0comment_list[[str]]List of word lists for comment generation. @username@ will be replaced by the media owner's username[['this', 'your'], ['photo', 'picture', 'pic', 'shot'], ['is', 'looks', 'is really'], ['great', 'super', 'good'], ['.', '...', '!', '!!']]tag_list[str]Tags to use for finding posts by hasthag or location(l:locationid from e.g.https://www.instagram.com/explore/locations/212999109/los-angeles-california/)['cat', 'car', 'dog', 'l:212999109']keywords[str]Words to use for finding profiles with username or biography contain these words[]tag_blacklist[str]Tags to ignore when liking posts[]user_blacklist{str: str}Users whose posts to ignore. Example:{"username": "", "username2": ""}type only the key and leave value empty -- it will be populated with userids on startup.{}max_like_for_one_tagintHow many media of a given tag to like at once (out of 21)5unfollow_break_minintMinimum seconds to break between unfollows15unfollow_break_maxintMaximum seconds to break between unfollows30log_modintLogging target (0 log to console, 1 log to file, 2 no log.)0proxiesdictAccess instagram through a proxy. {"http_proxy":"http://IP:PORT", "https_proxy":"http://IP:PORT"}(host:port or user:password@host:port)unfollow_not_followingboolUnfollow Condition: Unfollow those who do not follow you backTrueunfollow_inactiveboolUnfollow Condition: Unfollow those who have not posted in a while (inactive)Trueunfollow_probably_fakeboolUnfollow Condition: Unfollow accounts which skewed follow/follower ratio (probably fake)Trueunfollow_selebgramboolUnfollow Condition: Unfollow (celebrity) accounts with too many followers and not enough followingFalseunfollow_everyoneboolUnfollow Condition: Will unfollow everyone in unfollow queue (wildcard condition)FalseTelegram channel for instabot-py's logsCreate Telegram botAdd the following settings into the configuration:---# Send INFO notification to Telegram channellogging.loggers.InstaBot.handlers:-telegram-consolelogging.version:1logging.disable_existing_loggers:Falselogging.root.level:INFOlogging.formatters.simple:format:'%(asctime)s-{{login}}-%(name)s-%(levelname)s-%(message)s'logging.handlers.telegram:level:INFOclass:telegram_handler.TelegramHandlertoken:__YOUR__CHANNEL__TOKEN__chat_id:__CHAT_ID__formatter:simplelogging.handlers.console:level:DEBUGclass:logging.StreamHandlerformatter:simplestream:ext://sys.stdoutlogging.loggers.InstaBot.handlers:-telegram-consoleCommunityTelegram GroupContributingPlease feel free to contribute and submit PR requests. All help is appreciated. Look for issues with the labelneeds help. If you want to be in the developer team, please email me.