Skip to content

Commit

Permalink
un mirror de instabot
Browse files Browse the repository at this point in the history
  • Loading branch information
configuroweb committed Apr 21, 2020
0 parents commit 27a4bff
Show file tree
Hide file tree
Showing 52 changed files with 3,532 additions and 0 deletions.
113 changes: 113 additions & 0 deletions .gitignore
@@ -0,0 +1,113 @@

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Databases
.db

#Configurations
.ini
.INI

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# Sessions
.session

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# IDEs
.idea/
*.iml
*.db
*.session
DS/
nohup.out
12 changes: 12 additions & 0 deletions .travis.yml
@@ -0,0 +1,12 @@
dist: xenial # required for Python >= 3.7
language: python
python:
- 3.6
- 3.7
install: pip install tox-travis coverage
script: tox
after_success:
- bash <(curl -s https://codecov.io/bash)
notifications:
slack:
secure: R437kqbJa+M0qyo7phRPBPQWjafOpsd+AHSHLWX3rFWB2avPNqcCUao+4ZQTzWrifGgWvG98jARt08RziJye8RiZ9lDwcAUTHfEYFPwJywnLLudL9c99M00BXqEAwL156oBkH8Dkj2EyQr1PKtS/6uUJpJpUqH0eHKW/kbQWNMqQiET6aqv0xFoeLvY7It3x/ov3pfIcwz1LaHvqERxUe/cti//jIEv+RT6BfGvy0YJIou8qT9a4AeO23lHpiXbSAN7nxAKJFr+E7IyCyvRbzRliKTZqQg8uxBt5by/f7pAX7u3TEKMUcP5lDQKmWCOGqDHFHK03+gGLHz11OqtxJ6nfRTPgmQFydU49RjSAur6efxmwJNBiDp3J6mr/x4xi+pS/Jg6o/kGySsYNQ3690Csduc7UbijzVf2rZwQv+16/265c7cqn87NDPO2PFTVHkLXzbFdzR0DNeXrf7Go+aV68dnoXnxlQFjgBy0Aq4C1A5m9RNmGm/11srFcd8/+/13pnZWeKw/GXRq32xAMaM980+cuV4khedkdVAE7IWNeE3ndbySyCaAotLq5xfXi7N6O8VJErdWqQySpH03S9IYOvBXdXveZNqiZEJcyHhRVflaxrlxY//5LbTTquOkOgnIuqnwMtzEtcLXvF37E53tyDYqgy3MHKGM/tPVeMBcg=
11 changes: 11 additions & 0 deletions Dockerfile
@@ -0,0 +1,11 @@
FROM python:3.7.2-alpine3.9

RUN apk update && rm -rf /var/cache/apk/*

WORKDIR /app

RUN python3 -m pip install instabot-py

VOLUME ["/app"]

CMD [ "python3", "instabot_py/__main__.py" ]
80 changes: 80 additions & 0 deletions ISSUE_TEMPLATE.md
@@ -0,0 +1,80 @@
<!--
Before opening a new issue, please ensure:
- YOU HAVE READ THE ISSUE GUIDELINES! -> https://github.com/instabot-py/instabot.py/wiki/Issue-Guidelines
- You search for existing bugs/feature requests
- Remove extraneous template details
- Do not prefix title with type of issue (Feature Request, Bug, etc.) The appropriate labels will be added during triage.
- Do not delete any of the template, fill all of it in; even if you think it doesn't apply to your issue.
- If you fail to follow these simple instructions, we will close the ticket.
- [x] This is a checked box. **Do not leave spaces around the `x`!**
- Only newer version of instabot-py are supported (check the last version -> https://pypi.org/project/instabot-py/ )
-->

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])
- [ ] I have searched for other issues with the same problem or similar feature requests.

#### Select one:
- [ ] Bug
- [ ] Feature Request
- [ ] Technical Help (Please don't create an issue, join the facebook group or telegram channel)
- [ ] Other

#### Environment
- [ ] Are you hosting the bot on a VPS or other Cloud hosting?
- [ ] Are you running the code on your phone
- [ ] If so, have you tried running the code on your local machine?

```
Include more details about the environment
```

#### Operating System? (include version)
- [ ] macOS
- [ ] Windows
- [ ] Rasbian Linux Raspberry PI (include flavour)
- [ ] Linux (include flavour)
- [ ] Android (include terminal)

```
include the output of 'uname -a'
```

#### Python Version Requirement
- [ ] I am using Python 3.6 or above

#### Exact Python Version?
```
Include here the response of 'python --version' or 'python3 --version'
```

#### Pip Version?
```
Include here the response of 'pip --version' or 'pip3 --version'
```

#### Instabot Version?
```
Include here the response of 'instabot-py --version'
```

#### How you use the instabot
- [ ] instabot-py -c my-configfile.yml (my-configfile.yml is an example you may have a different file )
- [ ] instabot-py --login LOGIN --password PASSWORD
- [ ] instabot-py
- [ ] example.py (Deprecated, please install newer version)


#### Description of your issue

```
Include the contents of the error.log here (if applicable). < REPLACE THIS TEXT
```

#### Config

```
Ensure that you specify the configuration file in the command line.
Ensure that the default file instabot.config.yml contains only common settings if you use multiple accounts.
Include the contents of your config here (instabot-py -c config.yml --dump) (REMOVE YOUR USERNAME AND PASSWORD!) (if applicable). < REPLACE THIS TEXT
```
22 changes: 22 additions & 0 deletions LICENSE
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2016 Lev Pasha
https://github.com/instabot-py/instabot.py

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
143 changes: 143 additions & 0 deletions README.md
@@ -0,0 +1,143 @@
# Instabot.py 🤖 🌟

**Instabot.py** is an extremely light instagram bot that uses the undocumented Web API. Unlike other bots, Instabot.py does _not_ require Selenium or a WebDriver. Instead, it interacts with the API over simple HTTP Requests. It runs on most systems, including Raspberry Pi.

[![Chat on Telegram](https://img.shields.io/badge/Chat%20on-Telegram-brightgreen.svg)](https://t.me/joinchat/DYKH-0G_8hsDDoN_iE8ZlA)
[![Latest version on](https://badge.fury.io/py/instabot-py.svg)](https://badge.fury.io/py/instabot-py)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/instabot-py.svg)](https://pypi.org/project/instabot-py/)
[![Donate](https://img.shields.io/badge/PayPal-Donate%20to%20Author-blue.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=7BMM6JGE73322&lc=US)
<!-- [![Travis Pipelines build status](https://img.shields.io/travis/com/yurilaaziz/instabot-py.svg)](https://travis-ci.com/yurilaaziz/instabot-py/) -->

## Requirements

- Python v3.6 or greater
- Pip v18 or greater

## Quick Start 🚀

- **Make sure you have Python 3.6 or above installed**

- `python3 --version`

On Windows you might have to use `python` without 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.8**

- [Python on Windows](https://github.com/instabot-py/instabot.py/wiki/Installing-Python-on-Windows)
- [Python on Mac](https://github.com/instabot-py/instabot.py/wiki/Installing-Python-3.7-on-macOS)
- [Python on Raspberry Raspbian / Debian / Ubuntu](https://github.com/instabot-py/instabot.py/wiki/Installing-Python-3.7-on-Raspberry-Pi)

**Installation**

- From PyPi (Stable):

```
python3 -m pip install instabot-py
```
- From sources (Bleeding edge):

```
python3 -m pip install git+https://github.com/instabot-py/instabot.py
```
**Configuration** ⚙️

Run `instabot-py --create-config` command 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 `-c` flag: `instabot-py -c myconfiguration.yml`

**Start the bot** 🏁

- `instabot-py` or `python3 -m instabot_py`
- `instabot-py -c myconfiguration.yml` or `python3 -m instabot_py -c myconfiguration.yml`


The `%username%.db` file contains records of posts the bot has liked, and the users who has been followed/unfollowed.

The `%username%.session` file 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 --upgrade`
- `pip3 install instabot-py --no-cache-dir --upgrade`


## Parameters
| Parameter | Type| Description | Default value |
|:--------------------:|:---:|:----------------------------------------------------:|:--------------------------------:|
| login | str | Your instagram username | |
| password | str | Your instagram password | |
| start\_at\_h | int | Start program at the hour | 0 |
| start\_at\_m | int | Start program at the min | 0 |
| end\_at\_h | int | End program at the hour | 23 |
| end\_at\_m | int | End program at the min | 59 |
| database | dict| Contains the database configuration | {"type": "sql", "connection_string": "sqlite:///{{login}}.db"} |
| session\_file | str | change the name of session file so to avoid having to login every time. Set False to disable. | "username.session" |
| user_agent | str | Custom User Agent to look like a real browser | None |
| like_per_day | int | DEPRECATED, WILL BE REMOVED SOON, REPLACED BY like_per_run | |
| like_per_run | int | Number of photos to like per day (over 1000 may cause throttling) | 296 |
| like_followers_per_run | int | Number of your old followers to like their last photo per day (set to 0 to disable) | 0 |
| media_max_like | int | Maximum number of likes on photos to like (set to 0 to disable) | 0 |
| media_min_like | int | Minimum number of likes on photos to like (set to 0 to disable) | 0 |
| follow_per_day | int | DEPRECATED, WILL BE REMOVED SOON, REPLACED BY follow_per_run | 0 |
| follow_per_run | int | Users to follow per day | 156 |
| follow_time | int | Seconds to wait before unfollowing | 5 * 60 * 60 |
| follow_attempts | int | Attempts to make to follow someone | 10 |
| user_min_follow | int | Check user before following them if they have X minimum of followers. Set 0 to disable | 0 |
| user_max_follow | int | Check user before following them if they have X maximum of followers. Set 0 to disable | 0 |
| follow_time_enabled | bool| REMOVED, TO DISBALE Follow_time, just set it to 0 | -- |
| unfollow_per_day | int | DEPRECATED, WILL BE REMOVED SOON, REPLACED BY unfollow_per_run | 0 |
| unfollow_per_run | int | Users to unfollow per day | 199 |
| unfollow_recent_feed | bool| If 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. | True |
| unlike_per_day | int | DEPRECATED, WILL BE REMOVED SOON, REPLACED BY unlike_per_run | 0 |
| unlike_per_run | int | Number of media to unlike that the bot has previously liked. Set to 0 to disable. | 0 |
| time_till_unlike | int | How long to wait after liking media before unliking them. | 3 * 24 * 60 * 60 (3 days) |
| comments_per_day | int | Comments to post per day | 0 |
| comment_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_tag | int | How many media of a given tag to like at once (out of 21) | 5 |
| unfollow_break_min | int | Minimum seconds to break between unfollows | 15 |
| unfollow_break_max | int | Maximum seconds to break between unfollows | 30 |
| log_mod | int | Logging target (0 log to console, 1 log to file, 2 no log.) | 0 |
| proxies | dict | Access instagram through a proxy. {"http_proxy":"http://IP:PORT", "https_proxy":"http://IP:PORT"} (host:port or user:password@host:port) | |
| unfollow_not_following | bool | Unfollow Condition: Unfollow those who do not follow you back | True |
| unfollow_inactive | bool | Unfollow Condition: Unfollow those who have not posted in a while (inactive) | True |
| unfollow_probably_fake | bool | Unfollow Condition: Unfollow accounts which skewed follow/follower ratio (probably fake) | True |
| unfollow_selebgram | bool | Unfollow Condition: Unfollow (celebrity) accounts with too many followers and not enough following | False |
| unfollow_everyone | bool | Unfollow Condition: Will unfollow everyone in unfollow queue (wildcard condition) | False |

## Contributing
Please feel free to contribute and submit PR requests. All help is appreciated. Look for issues with the label [needs help](https://github.com/instabot-py/instabot.py/labels/needs%20help). If you want to be in developer team, please email me.

## Instabot with yaml config
By default, instabot looks for the configuration file `instabot.config.yml`.
It could be changed by exporting environment variable with the full path:
````bash
export INSTABOT_CONFIG_FILE=/path/to/file/instabot2.config.yml
````


```yaml

---
login : "username"
password : "password"
debug: 1
#Send INFO notification to Telegram channel
logging.handlers.telegram:
level: INFO
class: telegram_handler.TelegramHandler
token: __YOUR__CHANNEL__TOKEN__
chat_id: __CHAT_ID__
logging.loggers.InstaBot.handlers:
- telegram
- console
```

[Create Telegram bot for instabot](https://core.telegram.org/bots#3-how-do-i-create-a-bot)

## Community

- [Telegram Group](https://t.me/joinchat/DYKH-0G_8hsDDoN_iE8ZlA)

0 comments on commit 27a4bff

Please sign in to comment.