Ejemplo n.º 1
0
def run_instarb_auto_liker(user_id, insta_account_id, content):
    user_settings = UserToolSettings.query.filter_by(user_id=user_id).first()
    # headless_browser and live_broser opposite terms 
    headless_browser_value = False if user_settings.live_browser == 'True' else True 
    do_like_value = True if user_settings.do_like == 'True' else False
    like_randomize_value = True if user_settings.like_randomize == 'True' else False
    like_percentage_value = user_settings.like_percentage 

    user_insta_credentials = UserInstagramAccounts.query.filter_by(id=insta_account_id).first()
    insta_username = user_insta_credentials.insta_username
    insta_password = instagram_password_decryption(user_insta_credentials.insta_password)

    url_list_to_like = extract_url_from_text(content)
    
    user_workspace = os.path.join(app.root_path, 'workspace/')
    set_workspace(path=user_workspace)

    session = InstaPy(username=insta_username, password=insta_password, headless_browser=headless_browser_value, multi_logs=True)
    
    with smart_run(session, threaded=True):
        try:
            session.set_do_like(enabled=do_like_value, percentage=like_percentage_value)
            session.interact_by_URL(urls=url_list_to_like, randomize=like_randomize_value, interact=True)
            status = 'Success'
        except:
            print("CLOSED SESSION")
            status = 'Failed'
            session.end(threaded_session=True)

    return status
Ejemplo n.º 2
0
def scheduled_job():
    follow_likers_of_users = [
        'ramoswasoffside', 'passporttoearth', 'fav_skies',
        'super_photosunsets', 'njsunrise_sunset', 'adventures_shutter',
        'myskynow', 'newjerseyisbeautiful', 'igersmood', 'amazingly_sunsets',
        'hey_ihadtosnapthat', 'passion_4_living_photos', 'goventureorange',
        'onlythebestcapture', 'goandcapturethelight', 'bestpicturesgallery',
        'rthouse'
    ]
    random.shuffle(follow_likers_of_users)
    # set workspace folder at desired location (default is at your home folder)
    set_workspace(path="./")
    workspace_in_use = get_workspace()
    print(workspace_in_use["path"])

    # get an InstaPy session!
    session = InstaPy(username=os.environ['username'],
                      password=os.environ['password'],
                      headless_browser=True)

    with smart_run(session):
        """ Activity flow """
        # general settings
        session.set_dont_include(["friend1", "friend2", "friend3"])
        #session.follow_likers(follow_likers_of_users, photos_grab_amount=int(os.environ['photos_grab_amount']), follow_likers_per_photo=int(os.environ['follow_likers_per_photo']), randomize=False, sleep_delay=int(os.environ['follow_sleep_delay']), interact=False)
        session.unfollow_users(amount=int(os.environ['unfollow_amount']),
                               allFollowing=True,
                               style="LIFO",
                               unfollow_after=48 * 60 * 60,
                               sleep_delay=int(
                                   os.environ['unfollow_sleep_delay']))
Ejemplo n.º 3
0
def main():
    username = sys.argv[1]
    workspace_path = sys.argv[2]

    set_workspace(path=workspace_path)

    address = validate_database_address()
    create_database(address, Settings.logger, username)
Ejemplo n.º 4
0
def grab_followers(target_user='******'):
    # set workspace folder at desired location (default is at your home folder)
    set_workspace(path=None)

    # get an InstaPy session!
    session = InstaPy(username=Settings.login_username,
                      password=Settings.login_password,
                      headless_browser=True)

    with smart_run(session):
        selected_followers = session.grab_followers(
            username=target_user,
            amount="full",
            live_match=True,
            store_locally=True)

        return selected_followers
Ejemplo n.º 5
0
 def __init__(
         self,
         ig_name: str = None,
         ig_passwd: str = None,
         proxy_ip: str = None,
         proxy_port: str = None,
         proxy_name: str = None,
         proxy_passwd: str = None,
         workspace: str = None,
         headless: bool = False
 ):
     self.ig_name = ig_name
     self.ig_passwd = ig_passwd
     self.proxy_ip = proxy_ip
     self.proxy_port = proxy_port
     self.proxy_name = proxy_name
     self.proxy_passwd = proxy_passwd
     self.headless = headless
     set_workspace(workspace)
Ejemplo n.º 6
0
def main():
    # login credentials
    insta_username = sys.argv[1]
    insta_password = sys.argv[2]
    target_profile = sys.argv[3]
    workspace_path = sys.argv[4]

    set_workspace(path=workspace_path)

    session = InstaPy(username=insta_username,
                      password=insta_password,
                      headless_browser=True,
                      disable_image_load=True,
                      multi_logs=True)

    with smart_run(session):
        followers = session.grab_followers(username=target_profile,
                                           amount="full",
                                           live_match=True,
                                           store_locally=True)
        print(followers)

    for follower in followers:
        insert_follower(target_profile, follower)
Ejemplo n.º 7
0
#!/usr/bin/env python3
# imports
from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace
import random



# set workspace folder at desired location (default is at your home folder)
set_workspace(path='/root/InstaPy')

# get an InstaPy session!
session = InstaPy(username='******', password="******",headless_browser=True)

select_user=random.choice(['abeldamina','lighthousefll','bbcofnj'])

with smart_run(session):

   
    # Interacts with a certain amount of the users post
    session.set_user_interact(amount=3, randomize=False, percentage=100, media='Photo')

    #Likes User post based on perc.
    session.set_do_like(enabled=True, percentage=100)

    # session.set_relationship_bounds(enabled=True,
    #                                 max_followers=400,
    #                                 max_following=10000,
    #                                 min_posts=2,
    #                                 max_posts=300)
Ejemplo n.º 8
0
# -*- coding: utf-8 -*-
import time
from instapy import InstaPy
from instapy.util import smart_run
from instapy import set_workspace
from instapy import get_workspace


set_workspace(path="E:\\Work\\insta Macro\\Git\\afi\\InstaPy\\bin\\Debug\\")

session = InstaPy(username='******', password='******', headless_browser=False)

with smart_run(session):

    session.set_relationship_bounds(enabled=False, delimit_by_numbers=False)
    session.set_skip_users(skip_private=False)
    session.set_user_interact(amount=10, randomize=True, percentage=100, media='Photo')
    session.set_comments(['u'q',
                          u'w',
                          u'e',
                          u'r',
                          u't',
                          u'y'])
    session.set_do_comment(enabled=True, percentage=0)
    session.interact_user_following(['1','2','3','4','5'], amount=10, randomize=False)
    session.set_user_interact(amount=10, randomize=True, percentage=100, media='Photo')
    session.set_comments([u'q',
                          u'w',
                          u'e',
                          u'r',
                          u't',
Ejemplo n.º 9
0
import os
import time
import schedule
from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace

insta_username = os.environ.get('IG_USERNAME', 'username')
insta_password = os.environ.get('IG_PASSWORD', 'password')
friendlist = os.environ['IG_FRIENDLIST'].split(',')

set_workspace(path=os.path.dirname(os.path.realpath(__file__)))


def like():
    bot = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True)
    with smart_run(bot, threaded=True):
        print('💞 Showing friends some love 💖')
        bot.set_relationship_bounds(enabled=False)
        bot.set_skip_users(skip_private=False)
        bot.set_do_like(True, percentage=100)
        bot.interact_by_users(friendlist, amount=1, randomize=False)


print('-------------------------------------')
print(f'User: {insta_username}')
print(f'UserList: {friendlist}')
schedule.every(1).minutes.do(like)
while True:
Ejemplo n.º 10
0
def main():
    # login credentials
    insta_username = sys.argv[1]
    insta_password = sys.argv[2]
    target_profile = sys.argv[3]
    users_num = sys.argv[4]
    workspace_path = sys.argv[5]

    set_workspace(path=workspace_path)

    target_users = load_users_to_follow(target_profile, users_num)

    session = InstaPy(username=insta_username,
                      password=insta_password,
                      headless_browser=False,
                      disable_image_load=True,
                      multi_logs=True)

    with smart_run(session):
        session.set_simulation(enabled=True, percentage=80)
        session.set_action_delays(enabled=True,
                                  like=5,
                                  follow=7,
                                  unfollow=28,
                                  random_range=(70, 130))

        session.set_relationship_bounds(enabled=True,
                                        potency_ratio=None,
                                        delimit_by_numbers=True,
                                        max_followers=3000,
                                        max_following=2000,
                                        min_followers=5,
                                        min_following=5)

        session.set_skip_users(skip_private=False)

        session.set_quota_supervisor(
            enabled=True,
            sleep_after=["likes", "follows", "unfollows", "server_calls_h"],
            sleepyhead=True,
            stochastic_flow=True,
            notify_me=True,
            peak_likes=(100, 150),
            peak_follows=(50, 110),
            peak_unfollows=(50, 120),
            peak_server_calls=(1000, 3000))

        session.set_user_interact(amount=3,
                                  randomize=True,
                                  percentage=90,
                                  media='Photo')
        session.set_do_like(enabled=True, percentage=80)
        session.set_do_comment(enabled=True, percentage=25)
        session.set_comments(comments)
        session.set_do_follow(enabled=True, percentage=50, times=1)

        # activities
        session.follow_by_list(target_users, 1, sleep_delay=600, interact=True)

        session.unfollow_users(amount=random.randint(75, 100),
                               InstapyFollowed=(True, "nonfollowers"),
                               style="FIFO",
                               unfollow_after=24 * 60 * 60,
                               sleep_delay=600)

        session.unfollow_users(amount=random.randint(75, 100),
                               InstapyFollowed=(True, "all"),
                               style="FIFO",
                               unfollow_after=168 * 60 * 60,
                               sleep_delay=600)

        session.join_pods()
Ejemplo n.º 11
0
from instapy.database_engine import get_database
import sqlite3
import pandas as pd
from datetime import datetime
from dateutil.parser import parse
import json
import networkx as nx

#Parametrização
path_script = '/home/fm/Documents/clinstapy'
wsinstapy_folder = 'instapy_ws'
dbinstapy_folder = 'instapy_db'
browser_profile_path = r'/home/fm/Documents/clinstapy/firefox_clin_profile'
insta_acc_id = 'clinica''
insta_user = #yourinstauser
insta_psw = #yourinstapassword
user_stalk = #useryouwanna follow
set_workspace(os.path.join(path_script,wsinstapy_folder))
Settings.db_location = os.path.join(path_script,dbinstapy_folder)

#login
session = InstaPy(username=insta_user,password=insta_psw,headless_browser=False,split_db=True,multi_logs=True,browser_profile_path=browser_profile_path)
try:
    session.login()
except:
    print("If your credentials aren't save in cookies you need to write them manually")

#conexões
path_instapy_db = get_database(make=True)[0]
path_net_profiles = 'profiles_network.db'
con_instapy = sqlite3.connect(path_instapy_db)
con_net_prof = sqlite3.connect(path_net_profiles)
Ejemplo n.º 12
0
from dotenv import load_dotenv

from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace

load_dotenv()

# login credentials
insta_username = os.environ.get('IG_BOT_USER')
insta_password = os.environ.get('IG_BOT_PASS')

assert insta_username is not None
assert insta_password is not None

set_workspace("./InstaPy")

# TARGET data
""" Set similar accounts and influencers from your niche to target...
"""
targets = [
    'davidefpv',
    'milomilofpv',
    'overvoltofficial',
    'morollalessandro',
    'frankcitrofpv',
    'fpvmagazine',
    'tattulipos',
    'diatone.us',
    'mgfpv',
    'johnny_fpv',
Ejemplo n.º 13
0
from dotenv import load_dotenv

load_dotenv()

from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace
from os import getenv

import schedule
import time

set_workspace(path=getenv('LITTLE_SWAN_DANCE_WORKSPACE'))


def job():
    session = InstaPy(username=getenv('LITTLE_SWAN_DANCE_USERNAME'), password=getenv('LITTLE_SWAN_DANCE_PASSWORD'),
                      headless_browser=True).login()
    session.set_quota_supervisor(enabled=True,
                                 sleep_after=["likes", "comments_d", "follows", "unfollows", "server_calls_h"],
                                 sleepyhead=True, stochastic_flow=True, notify_me=False,
                                 peak_likes_hourly=20,
                                 peak_likes_daily=100,
                                 peak_comments_hourly=12,
                                 peak_comments_daily=180,
                                 peak_follows_hourly=20,
                                 peak_follows_daily=150,
                                 peak_unfollows_hourly=10,
                                 peak_unfollows_daily=50,
                                 peak_server_calls_hourly=None,
                                 peak_server_calls_daily=4000)
Ejemplo n.º 14
0
from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace
import getpass

set_workspace('/home/fabio/Instapy')

#credenciais
insta_username = input("Usuário: ")
insta_password = getpass.getpass("Senha: ")

#iniciar sessão
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=False,
                  want_check_browser=False)

comentarios = [u'@{} maravilhosa!!! :clap::clap::clap:', u'amei :heart:']

with smart_run(session):
    #configuração
    session.set_comments(comentarios)
    session.set_do_comment(enabled=True, percentage=100)
    session.set_delimit_commenting(enabled=True,
                                   max_comments=10000,
                                   min_comments=0)
    session.set_do_like(enabled=True, percentage=100)

    #ação
    session.interact_by_users(['p.vitar'],
                              amount=2,
Ejemplo n.º 15
0
import schedule
import time

from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace

from config.config import InstaBotConfig

# reading configuration from json configuration file
InstaBotConfig.read_from_file()
insta_username = InstaBotConfig.USERNAME
insta_password = InstaBotConfig.PASSWORD

# path to your workspace
set_workspace(path='InstaPy')


def insta_bot():
    # run with browser GUI
    session = InstaPy(username=insta_username, password=insta_password)

    # run without browser GUI
    # session = InstaPy(username=username, password=password, headless_browser=True)
    with smart_run(session):

        session.login()
        session.like_by_tags(['cameroun', 'douala', 'yaounde', 'limbe'],
                             amount=5)
        session.set_do_follow(True, percentage=50)
        session.set_do_comment(True, percentage=50)
Ejemplo n.º 16
0
from instapy import smart_run
from instapy import set_workspace
import random
from instapy import get_workspace

follow_likers_of_users = [
    'ramoswasoffside', 'passporttoearth', 'fav_skies', 'super_photosunsets',
    'njsunrise_sunset', 'adventures_shutter', 'myskynow',
    'newjerseyisbeautiful', 'igersmood', 'amazingly_sunsets',
    'hey_ihadtosnapthat', 'passion_4_living_photos', 'goventureorange',
    'onlythebestcapture', 'goandcapturethelight', 'bestpicturesgallery',
    'rthouse'
]
random.shuffle(follow_likers_of_users)
# set workspace folder at desired location (default is at your home folder)
set_workspace(path="./")
workspace_in_use = get_workspace()
print(workspace_in_use["path"])
insta_username = os.environ['username']
insta_password = os.environ['password']
print(f"Logging in {insta_username} with {insta_password}")
# get an InstaPy session!
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True)

with smart_run(session):
    """ Activity flow """
    # general settings
    session.set_dont_include(["friend1", "friend2", "friend3"])
    #session.follow_likers(follow_likers_of_users, photos_grab_amount=int(os.environ['photos_grab_amount']), follow_likers_per_photo=int(os.environ['follow_likers_per_photo']), randomize=False, sleep_delay=int(os.environ['follow_sleep_delay']), interact=False)
Ejemplo n.º 17
0
# Official documentation
# https://instapy.org/settings/

# Additional imports random amount for interactions
import random
from instapy import InstaPy
from instapy import Settings
from instapy import set_workspace
from instapy.util import smart_run
import os

#####################
# InstaPy Settings  #
#####################

set_workspace(path="/InstaPy/Data/")
#base_dir = '/InstaPy/'
#Settings.log_location = os.path.join(base_dir, 'logs')
#Settings.database_location = os.path.join(base_dir, 'db', 'instapy.db')
#Settings.chromedriver_location = os.path.join(base_dir, 'assets', 'chromedriver')
#Settings.browser_location = '/path/to/chromedriver'

#####################
# Automate Settings #
#####################

# Login credentials
insta_username = '******'
insta_password = '******'

# Login data
Ejemplo n.º 18
0
import sqlite3
import pandas as pd
import numpy as np
import datetime


#Parametrização
path_script = '/home/fm/Documents/clinstapy'
wsinstapy_folder = r'/home/fm/Documents/clinstapy/instapy_ws'
dbinstapy_folder = r'/home/fm/Documents/clinstapy/instapy_db'
browser_profile_path = r'/home/fm/Documents/clinstapy/firefox_clin_profile'
path_net_profiles = r'/home/fm/Documents/clinstapy/profiles_network.db'
                     
insta_acc_id = #databasename
insta_user = #youruser
insta_psw = #password
user_stalk = #someone you wanna stalk

set_workspace(os.path.join(path_script,wsinstapy_folder))
Settings.db_location = os.path.join(path_script,dbinstapy_folder)

#login
session = InstaPy(username=insta_user,
                  password=insta_psw,
                  headless_browser=False,
                  split_db=True,
                  multi_logs=True)#,
                  #browser_profile_path=browser_profile_path)
try:
    session.login()
except:
    print("esses erros foram porque o login foi feito por cookies")
Ejemplo n.º 19
0
    shuffle(all_tags)
    all_tags = all_tags[0:int(len(all_tags) * uniform(0.7, 1))]
    return all_tags


def init_new_session():
    return InstaPy(username=insta_username,
                   password=insta_password,
                   headless_browser=False,
                   nogui=no_gui,
                   multi_logs=True,
                   bypass_with_mobile=True)


# set workspace folder at desired location (default is at your home folder)
set_workspace(path=workspace_path)


def start_session():
    session = init_new_session()
    all_tags = get_shuffled_tags()

    with smart_run(session):
        # start = datetime.datetime.now()
        #
        # while True:
        #     if (datetime.datetime.now() - start).total_seconds() > SESSION_DURATION:
        #         return None

        # settings
        session.set_relationship_bounds(enabled=True,
Ejemplo n.º 20
0
# imports
from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace
from instapy import get_workspace
import time
import config
import schedule


insta_username = config.username  # <- enter username here
insta_password = config.password  # <- enter password here

set_workspace(path="/Users/tz3m/Desktop/instagram")

session = InstaPy(username=insta_username, password=insta_password,headless_browser=False)

comments=[

      {'mandatory_words': ["#customaf1", "#customairforceones"], 'comments': ["Those AF1 look dope !", "Damn! What an outstanding pair of air force ones."]},

      {'mandatory_words': ["#customkicks", "#custom_kicks"], 'comments': ["Amazing kicks! They look so fresh. Keep up the good work!"]},

      {'mandatory_words': ["#customsneakers", "#custom_sneakers"], 'comments': ["Sneakers made by humans for gods! Great job mate!"]},

      {'mandatory_words': ["#customkicks", "#custom_kicks"], 'comments': ["I would kill for a pair of those!!!"]},
]



def unfollow():
Ejemplo n.º 21
0
# ---------------------------------------------------------------------------

setting = get(f'/settings/{setting_ident}')

# user args
instapy_args = dict()
for param in setting['params']:
    instapy_args[param['name']] = param['value']

# custom args
instapy_args['log_handler'] = log_handler
instapy_args['browser_binary_path'] = chromedriver_path

# set assets folder as a workspace
ASSETS = os.path.dirname(os.path.abspath(__file__)) + '/assets'
set_workspace(ASSETS)

# get an InstaPy session!
session = InstaPy(**instapy_args)


# function that will be executed before sig kill, to the browser window closes
def exit_browser(*args):
    session.browser.quit()


if platform.system() != 'Windows':
    signal.signal(signal.SIGUSR1, exit_browser)

with smart_run(session):
    for job in jobs:
Ejemplo n.º 22
0
import schedule
import time
import os
import json
from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace

# login credentials
with open('credentials.json', 'r') as f:
    data = json.loads(f.read())

# path to your workspace
set_workspace(path=os.getcwd() + '/data/')

users_list = ['spotted_mari', 'spottedmarinoni']


def job(username, password):

    session = InstaPy(
        username=username,
        password=password,
        headless_browser=False,
    )

    with smart_run(session):

        # session.set_dont_include(["friend1", "friend2", "friend3"])

        session.set_quota_supervisor(enabled=True,
Ejemplo n.º 23
0
from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace

#Add COmments here seperated by a ,
comments = [
    'Nice shot! @{}', 'I love your profile! @{}',
    'Getting inspired by you @{}', ':raised_hands: Yes!', '@{} :heart::heart:',
    'Love your posts @{}', 'Looks awesome @{}', 'Getting inspired by you @{}',
    ':raised_hands: Yes!', '@{}:revolving_hearts::revolving_hearts:',
    '@{}:fire::fire::fire:', 'Inspiring post!',
    'I can feel your passion @{} :muscle:'
]

# set workspace folder at desired location (default is at your home folder)
set_workspace(path=None)

# get an InstaPy session!
session = InstaPy()

with smart_run(session):
    # general settings
    session.set_dont_include(["friend1", "friend2", "friend3"])

    # activity
    #session.like_by_tags(["natgeo"], amount=10)

    # comment stuff
    session.set_do_comment(enabled=True, percentage=35)
    session.set_comments(comments)
    session.join_pods(topic='entertainment', engagement_mode='no_comments')
Ejemplo n.º 24
0
from dotenv import load_dotenv

load_dotenv()

from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace
from os import getenv

import schedule
import time

set_workspace(path=getenv('LEO_JUNE_WORKSPACE'))


def job():
    session = InstaPy(username=getenv('LEO_JUNE_USERNAME'), password=getenv('LEO_JUNE_PASSWORD'),
                      headless_browser=False).login()
    session.set_quota_supervisor(enabled=True,
                                 sleep_after=["likes", "comments_d", "follows", "unfollows", "server_calls_h"],
                                 sleepyhead=True, stochastic_flow=True, notify_me=False,
                                 peak_likes_hourly=20,
                                 peak_likes_daily=100,
                                 peak_comments_hourly=12,
                                 peak_comments_daily=180,
                                 peak_follows_hourly=20,
                                 peak_follows_daily=150,
                                 peak_unfollows_hourly=10,
                                 peak_unfollows_daily=50,
                                 peak_server_calls_hourly=None,
                                 peak_server_calls_daily=4000)