InstaPy – is an open source Automate.

Install

Install Docker

Ubuntu

1) `#Install docker`       sudo apt install docker.io -y                                                                                `#Start docker`         sudo systemctl start docker                                                                                  `#Autostart docker`     sudo systemctl enable docker                                                                                

CentOS

1) `#Install docker`       yum install docker -y                                                                                        `#Start docker`         systemctl start docker                                                                                       `#Autostart docker`     systemctl enable docker                                                                                     

Fedora

1) `#Install docker`       sudo dnf install docker -y                                                                                   `#Start docker`         sudo systemctl start docker                                                                                  `#Autostart docker`     sudo systemctl enable docker                                                                                

Download InstaPy

2) sudo docker pull smied/instapy:latest `#Download/update image`

Create container from image

3) sudo docker run -d \ --name=InstaPy -e TZ=Europe/Moscow --restart=always                                                             `#Set your time zone` \ --volume /Docker/InstaPy/:/InstaPy/Data/                                                                        `#(For backup work)` \ --volume InstaPy-templates:/InstaPy/Templates/                                                                  `#(For backup work)` \ --tmpfs /tmp --tmpfs /run --tmpfs /run/lock                                                                     `#(For systemd work)` \ --volume /sys/fs/cgroup:/sys/fs/cgroup:ro                                                                       `#(For systemd work)` \ smied/instapy:latest

Edit template

template “quickstart.py”

4) docker exec -ti InstaPy nano /InstaPy/quickstart.py

or

enhanced template “template_main.py”

4) docker exec -ti InstaPy nano /InstaPy/Templates/template_main.py

or

nano /var/lib/docker/volumes/InstaPy-templates/_data/template_main.py

Start

template “quickstart.py”

5) docker exec -ti InstaPy bash    python3 /InstaPy/quickstart.py

or

docker exec -ti InstaPy python3 /InstaPy/quickstart.py

enhanced template “template_main.py”

5) docker exec -ti InstaPy bash    python3 /InstaPy/Templates/template_main.py

or

docker exec -ti InstaPy python3 /InstaPy/Templates/template_main.py

Cron

SHELL=/bin/bash 0 9 * * * sleep `expr $RANDOM \% 10`h `expr $RANDOM \% 10`m `expr $RANDOM \% 10`s; sudo docker exec InstaPy python3 /InstaPy/quickstart.py > /dev/null

or

SHELL=/bin/bash 0 9 * * * sleep `expr $RANDOM \% 10`h `expr $RANDOM \% 10`m `expr $RANDOM \% 10`s; sudo docker exec InstaPy python3 /InstaPy/quickstart.py |& tee -a /Docker/Scripts/Logs/InstaPy.log

or

SHELL=/bin/bash 0 9 * * * sleep `expr $RANDOM \% 10`h `expr $RANDOM \% 10`m `expr $RANDOM \% 10`s; sudo docker exec InstaPy python3 /InstaPy/Templates/template_main.py > /dev/null

or

SHELL=/bin/bash 0 9 * * * sleep `expr $RANDOM \% 10`h `expr $RANDOM \% 10`m `expr $RANDOM \% 10`s; sudo docker exec InstaPy python3 /InstaPy/Templates/template_main.py |& tee -a /Docker/Scripts/Logs/InstaPy.log

Cron for update InstaPy Docker

(every month on the 1st day at 00:00) 0 0 1 * * docker container rm --force InstaPy && sudo docker pull smied/instapy:latest && sudo docker run -d --name=InstaPy -e TZ=Europe/Moscow --restart=always --volume /Docker/InstaPy/:/InstaPy/Data/ --volume InstaPy-templates:/InstaPy/Templates/ --tmpfs /tmp --tmpfs /run --tmpfs /run/lock --volume /sys/fs/cgroup:/sys/fs/cgroup:ro smied/instapy:latest

Working through proxy

sudo docker run -d \ --name=InstaPy -e TZ=Europe/Moscow --restart=always                                                             `#Set your time zone` \ --volume /Docker/InstaPy/:/InstaPy/Data/                                                                        `#(For backup work)` \ --volume InstaPy-templates:/InstaPy/Templates/                                                                  `#(For backup work)` \ --tmpfs /tmp --tmpfs /run --tmpfs /run/lock                                                                     `#(For systemd work)` \ --volume /sys/fs/cgroup:/sys/fs/cgroup:ro                                                                       `#(For systemd work)` \ --env HTTP_PROXY="https://<IP>:<Port>" \ smied/instapy:latest

or

set in config (add to session = InstaPy) proxy_address=proxy_host, proxy_port=proxy_port, proxy_username=proxy_username, proxy_password=proxy_password,

Use Business Intelligence (KPI dashboard)

if you use enhanced template “template_main.py”

1) docker run -d \  --name=Metabase -e TZ=Europe/Moscow --restart=always \  --memory="1g" --cpus="1" \  -p 3500:3000 \  --volume /Docker/Metabase:/metabase.db \  --volume /Docker/InstaPy/:/Volume \  metabase/metabase
2) in Metabase settings add sqlite /Volume/InstaPy/db/instapy_<YourAccount>.db

Use CLI

Help

instapy --help

Use

instapy -u USR -p PSW -f FILE/LINK -t 'TEXT CAPTION'

CLI Options

optionrequireddefaultdescription
-uyesusername
-pyespassword
-fyesfile/media to upload
-toptionaltext caption for post
-soptionalupload a story

Image Format

instapy-cli support images in the format of JPG/JPEG/PNG.

FAQ

Main

  1. Q. Where InstaPy folder?A. /usr/local/lib/python3.6/dist-packages/instapy – App/InstaPy/ – Databases, Logs, Templates

limits

  1. Likes
  2. Subscription/Unsubscribe
  3. Direct messages
  4. Comments
  5. Mentions
  6. Posts in the feed
  7. Blocking users

Likes

Age accountPer hourDailyMounthly
<3 months15-20450-55016500
3 – 6 months25-50600-120036000
>6 months35-501000-120036000

Subscription

Age accountPer hourDailyMounthly
<3 months1414000
3 – 6 months3006000
>6 months3006000

Unsubscribe

Age accountPer hourDailyMounthly
<3 months3072021600
3 – 6 months3072021600
>6 months60144043200

Direct messages

Age accountPer hourDailyMounthly
<3 months3-520-30900
3 – 6 months10-1530-401200
>6 months15-2040-501500

Comments

Age accountPer hourDailyMounthly
<3 months20-30450-55016500
3 – 6 months30-40600-120036000
>6 months40-501000-120036000

Mentions

Age accountPer hourDailyMounthly
<3 months53030000
3 – 6 months53030000
>6 months56060000

Posts in the feed

Age accountPer hourDailyMounthly
<3 months2-390
3 – 6 months2-390
>6 months9-12360

Blocking users

Age accountDailyInterval
6015-25 seconds

Issues

IssueSolution
OSError: [Errno 26] Text file busy: ‘/root/InstaPy/assets/gecko/v0.28.0/geckodriver-v0.28.0-linux64/geckodriver’reboot container


If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Write A Comment

Spelling error report

The following text will be sent to our editors: