{"id":17874411,"url":"https://github.com/marcosschroh/pyinstamation","last_synced_at":"2025-06-25T05:45:13.046Z","repository":{"id":53535674,"uuid":"101566077","full_name":"marcosschroh/pyinstamation","owner":"marcosschroh","description":"Easy to use, config oriented, instagram bot, written in python 3","archived":false,"fork":false,"pushed_at":"2022-07-15T18:40:39.000Z","size":1992,"stargazers_count":10,"open_issues_count":7,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-11T04:02:34.029Z","etag":null,"topics":["bot","instagram","instagram-bot","python3","selenium"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcosschroh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-27T16:41:35.000Z","updated_at":"2025-05-08T15:38:54.000Z","dependencies_parsed_at":"2022-09-09T09:51:09.682Z","dependency_job_id":null,"html_url":"https://github.com/marcosschroh/pyinstamation","commit_stats":null,"previous_names":["dscovr/pyinstamation"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/marcosschroh/pyinstamation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosschroh%2Fpyinstamation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosschroh%2Fpyinstamation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosschroh%2Fpyinstamation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosschroh%2Fpyinstamation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcosschroh","download_url":"https://codeload.github.com/marcosschroh/pyinstamation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcosschroh%2Fpyinstamation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260126793,"owners_count":22962691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","instagram","instagram-bot","python3","selenium"],"created_at":"2024-10-28T11:08:50.917Z","updated_at":"2025-06-25T05:45:12.996Z","avatar_url":"https://github.com/marcosschroh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PYINSTAMATION\n\n\u003e Easy to use, config oriented, instagram bot, written in python 3\n\n[![Build Status](https://travis-ci.org/dscovr/pyinstamation.svg?branch=master)](https://travis-ci.org/dscovr/pyinstamation)\n[![codecov](https://codecov.io/gh/dscovr/pyinstamation/branch/master/graph/badge.svg)](https://codecov.io/gh/dscovr/pyinstamation)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n![](./docs/demo.gif)\n\n## **Table of Contents**\n\n- [PYINSTAMATION](#pyinstamation)\n  - [Features](#features)\n  - [Quickstart](#quickstart)\n  - [API Example](#api-example)\n  - [Prerequisites](#prerequisites)\n  - [Commands](#usage)\n  - [Configuration](#configuration)\n    - [Posts](#posts)\n    - [Followers](#followers)\n    - [Pics](#pics)\n      - [Pics \u003e files](#pics-files)\n  - [Running periodically](#running-periodically)\n  - [Troubleshooting](#troubleshooting)\n\n\n## Features\n\n- [x] Upload pictures\n- [x] Farm followers with the follow/unfollow technique\n- [x] Like and comment by tags\n- [x] Metrics persisted in db\n- [x] Logging\n- [x] Comment generator\n- [ ] Dockerization\n- [ ] Auto update user's description\n\n\n## Quickstart\n\n1. Check [pyvirtualdisplay is installed properly](http://pyvirtualdisplay.readthedocs.io/en/latest/#general)\n2. Create [virtualenv](https://virtualenv.pypa.io/en/stable/installation/)\n3. Run:\n\n```\nmake init\n# set username and password in `config.yaml` and configure at will\nmake run-bot\n```\n\n\n## API Example\n\nIf you want to check how to use the bot in depth check the [examples](./examples) or read the\nsource.\n\nTo run the examples just type, but remember to update the constants (user, pass, post url):\n\n`python examples/bot_like_and_comment.py`\n\n`python examples/bot_upload_picture.py`\n\n\nSimple example\n\n```python\nfrom pyinstamation.bot import InstaBot\nfrom pyinstamation.scrapper import InstaScrapper\n\n\nPOST_LINK = 'p/not_a_real_post_id'\nUSERNAME = 'replace_this_with_your_username'\nPASSWORD = 'replace_this_with_your_password'\n\ns = InstaScrapper()\nbot = InstaBot(s, username=USERNAME, password=PASSWORD)\n\nbot.start_browser()\nbot.login()\nbot.like(POST_LINK)\nbot.comment(POST_LINK, 'this is a simple comment')\nbot.stop()\n\n```\n\n\n## Prerequisites\n\n#### OS\n\n```\nLinux (Tested in debian)\nOS X\n```\n\n#### SO Packages\n\n###### Linux\n\n```\nsudo apt-get install xvfb xserver-xephyr\n```\n\n\n#### Python versions\n\n```\npython \u003e3.5\npython \u003e2.7  (not supported officially)\n```\n\nRemember to create a [virtualenv](https://virtualenv.pypa.io/en/stable/installation/)\n\n\n## Commands\n\n| Command | Description |\n| --- | --- |\n| `make init` | downloads webdriver and creates a new conf based on the default one |\n| `make run-bot` | starts running the bot (remember to at least set the username and password) |\n| `make install-deps` | installs python dependencies |\n| `make start-conf` | creates a new configuration file with the template from `default.config.yaml` |\n| `make webdriver` | downloads selenium's webdriver |\n\n\n## Configuration\n\nCreate a `config.yaml` and tune it at will, or use `make init`.\nThe options are divided in different sections.\n\n| Option | Type | Description | Default |\n| --- | --- | --- | --- |\n| `username` * | str | instagram username to operate. Only username works with statistics, not email | --- |\n| `password` ** | str | username's password | --- |\n| `hide_browser` | bool | do not display the browser | False |\n| `browser_type` | str | browser type (chrome/firefox)| chrome |\n\n\n\\*  Required\n\n** Required unless the bot is launched with `-p [PASSWORD]`\n\n\n### Posts\n\n| Option | Type | Description | Default |\n| --- | --- | --- | --- |\n| `search_tags` | str | comma separated tags to search for | [] |\n| `ignore_tags` | str | comma separated tags to ignore if a post contains them while searching | [] |\n| `posts_per_day` | int | number of posts to be processed in total, ignored does not count |\n| `posts_per_hashtag` | int | number of posts to be processed per hashtag (not recommended) |\n| `likes_per_day` | int | maximum likes given in a day | 100 |\n| `like_probability` | float | probability to give a like | 0.5 |\n| `comments_per_day` | int | maximum comments given in a day | 10 |\n| `comment_probability` | float| probability to comment | 0.5 |\n| `comment_enabled` | bool| bot will comment in the searched posts | True |\n| `comment_generator` | bool | bot will generate a random generic comment | True |\n| `custom_comments` | array | in case you don't want random comments, you can provide them | [] |\n\n### Followers\n\n| Option | Type | Description | Default |\n| --- | --- | --- | --- |\n| `follow_enable` | bool | while searching the bot will also follow people | True |\n| `min_followers` | None or int | minimum number followers that a user must have to follow. Lower bound | 100 |\n| `max_followers` | None or int | will follow users with less than this amount of followers. Upper bound | 7000 |\n| `follow_probability` | float | chance to follow someone while searching, between 0 and 1 | 0.5 |\n| `ignore_users` | array | users not to follow | [] |\n| `follow_per_day` | int | max number of users to follow | 50 |\n| `unfollow_followed_users` | bool | after a few days the bot will stop following the users followed | True |\n\n### Pics\n\n| Option | Type | Description | Default |\n| --- | --- | --- | --- |\n| `upload` | bool | when enabled attempts to upload a picture if there is one to upload | False |\n| `files` | collection | the contents of the files to upload are below | [] |\n\n#### Pics \u003e files\n\n| Option | Type | Description | Default |\n| --- | --- | --- | --- |\n| `path` * | str | absolute path to the file location. |\n| `datetime` | str | format ISO 8061: `%Y-%m-%dT%H:%M:%S` eg: `2017-08-18T18:00:00`. For now, time is ignored, but the idea is to take it into account | None |\n| `comment` | str | comment to be added when the pic is posted  | None |\n\n\\*  Required\n\nFor config template check [default.config.yaml](./default.config.yaml)\n\n\nWe told you it was easy.\n\n## Running periodically\n\nUse [Crontab](http://www.adminschoice.com/crontab-quick-reference)\nUse [Celery](http://docs.celeryproject.org/en/latest/userguide/daemonizing.html) and\n[Celery Beat](http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html) (with [supervisord](supervisord.org))\n\n\n## Troubleshooting\n\n* If you have an error similar to `FileNotFoundError: [Errno 2] No such file or directory: 'Xephyr'` or `WebDriverException: The browser appears to have exited before we could connect?`\ntry installing the missing dependency `sudo apt-get install xvfb xserver-xephyr`.\nFor more information check [pyvirtualdisplay docs](http://pyvirtualdisplay.readthedocs.io/en/latest/#general)\n* If you have an error similar to `OSError: [Errno 8] Exec format error` try downloading manually\nthe chromedriver from [here](https://chromedriver.storage.googleapis.com/index.html?path=2.31/)\n* For Raspberry Pi you need a special chromedriver, check [here](https://www.raspberrypi.org/forums/viewtopic.php?f=63\u0026t=95322)\nor [here](https://stackoverflow.com/questions/31190164/using-selenium-on-raspberry-pi-with-chromium)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcosschroh%2Fpyinstamation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcosschroh%2Fpyinstamation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcosschroh%2Fpyinstamation/lists"}