Example #1
0
""" Quickstart script for InstaPy usage """
# imports
from instapy import InstaPy
from instapy.util import smart_run

# login credentials
insta_username = '******'
insta_password = '******'

# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True,
                  bypass_suspicious_attempt=True)

with smart_run(session):
    """ Activity flow """
    # general settings
    session.set_dont_unfollow_active_users(enabled=True, posts=5)

    session.set_relationship_bounds(enabled=True,
                                    delimit_by_numbers=True,
                                    potency_ratio=None,
                                    max_followers=50000,
                                    min_followers=45,
                                    min_following=77)

    session.set_skip_users(skip_private=True,
                           private_percentage=100,
                           skip_no_profile_pic=False,
Example #2
0
        ':raised_hands: Yes!',
        'Great Post! :raised_hands:',
        'Love it! @{}',
        'Haha love this :raised_hands:',
        'Amazing :raised_hands:',
        'Dope picture @{}',
        'Cool Photo :raised_hands:']

#another way of setting up a session with a proxy - haven't tried this yet
#session = InstaPy(username=insta_username, password=insta_password, proxy_address='8.8.8.8', proxy_port=8080)


# get an InstaPy session
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True,
                  disable_image_load=False) #use this to decrease bandwidth if not actively watching

with smart_run(session):
  """ Activity flow """	
  #SET PARAMETERS#
  
  session.set_do_like(enabled=True, percentage=94)
  #This is used to choose which type of account to include based on follower/following ratios
  session.set_relationship_bounds(enabled=True,
                                  potency_ratio=None,
                                  delimit_by_numbers=True,
                                  max_followers=None,
                                  max_following=None,
                                  min_followers=0,
                                  min_following=200,
# login credentials
insta_username = '******'
insta_password = '******'

comments = [
    'Nice shot! @{}', 'I love your profile! @{}',
    'Your feed is an inspiration :thumbsup:', 'Just incredible :open_mouth:',
    'What camera did you use @{}?', 'Love your posts @{}', 'Looks awesome @{}',
    'Getting inspired by you @{}', ':raised_hands: Yes!',
    'I can feel your passion @{} :muscle:'
]

# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=False)

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

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

    # Joining Engagement Pods
    session.set_do_comment(enabled=True, percentage=35)
    session.set_comments(comments)
    session.join_pods(topic='sports', engagement_mode='no_comments')
from instapy import InstaPy

# Write your automation here
# Stuck ? Look at the github page or the examples in the examples folder

insta_username = ''
insta_password = ''

dont_like = ['food', 'girl', 'hot']
ignore_words = ['pizza']
friend_list = ['friend1', 'friend2', 'friend3']

# If you want to enter your Instagram Credentials directly just enter
# username=<your-username-here> and password=<your-password> into InstaPy
# e.g like so InstaPy(username="******", password="******")

bot = InstaPy(username=insta_username,
              password=insta_password,
              selenium_local_session=False)
bot.set_selenium_remote_session(selenium_url='http://selenium:4444/wd/hub')
bot.login()
bot.set_upper_follower_count(limit=2500)
bot.set_do_comment(True, percentage=10)
bot.set_comments(['Cool!', 'Awesome!', 'Nice!'])
bot.set_dont_include(friend_list)
bot.set_dont_like(dont_like)
bot.set_ignore_if_contains(ignore_words)
bot.like_by_tags(['dog', '#cat'], amount=100)
bot.end()
friends = ['list of friends I do not want to interact with']

like_tag_list = [
    'vegan', 'veganfoodshare', 'veganfood', 'whatveganseat', 'veganfoodie',
    'veganism', 'govegan', 'veganism', 'vegansofig', 'veganfoodshare',
    'veganfit', 'veggies'
]

# prevent posts that contain some plantbased meat from being skipped
ignore_list = ['vegan', 'veggie', 'plantbased']

accounts = ['accounts with similar content']

# get a session!
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True)

with smart_run(session):
    # settings
    session.set_relationship_bounds(enabled=True, max_followers=15000)

    session.set_dont_include(friends)
    session.set_dont_like(dont_likes)
    session.set_ignore_if_contains(ignore_list)

    session.set_user_interact(amount=2, randomize=True, percentage=60)
    session.set_do_follow(enabled=True, percentage=40)
    session.set_do_like(enabled=True, percentage=80)

    # activity
Example #6
0
from instapy import InstaPy

session = InstaPy(username='******', password='******')
session.login()

for liked_image_page in session.like_by_feed_generator():
    username_of_image_poster = liked_image_page.browser.find_element_by_xpath('//article/header/div[2]/div[1]/div/a')\
        .get_attribute("title")

    # click likes of image
    liked_image_page.browser.find_element_by_xpath(
        "//main//div//div//article//div[2]/section[2]/div/a"
    ).click()

    # find likers
    likers = [
        liker.get_attribute('title')
        for liker in liked_image_page.browser.find_elements_by_xpath(
            "//div[@class='_ntka7']//li/div/div/div/div/a"
        )
    ]

    # like some posts of likers
    for liker in likers:
        if liker not in [username_of_image_poster, session.username]:
            liked_image_page.like_by_users([liker], randomize=True)

session.end()
Example #7
0
  In my comments, I always ask for feedback, use more than 4 words and
  always have emojis.
  My comments work very well, as I get a lot of feedback to my posts and
  profile visits since I use this tactic.
  As I target mainly active accounts, I use two unfollow methods. 
  The first will unfollow everyone who did not follow back within 12h.
  The second one will unfollow the followers within 24h.
"""

# !/usr/bin/python2.7
import random
from instapy import InstaPy
from instapy import smart_run

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

# let's go! :>
with smart_run(session):
    hashtags = ['travelcouples', 'travelcommunity', 'passionpassport',
                'travelingcouple',
                'backpackerlife', 'travelguide', 'travelbloggers',
                'travelblog', 'letsgoeverywhere',
                'travelislife', 'stayandwander', 'beautifuldestinations',
                'moodygrams',
                'ourplanetdaily', 'travelyoga', 'travelgram', 'sunsetporn',
                'lonelyplanet',
                'igtravel', 'instapassport', 'travelling', 'instatraveling',
                'travelingram',
                'mytravelgram', 'skyporn', 'traveler', 'sunrise',
                'sunsetlovers', 'travelblog',
Example #8
0
from instapy import InstaPy

insta_username = '******'
insta_password = '******'

# if you want to run this script on a server,
# simply add nogui=True to the InstaPy() constructor
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True,
                  disable_image_load=True,
                  want_check_browser=False)
session.login()

# set up all the settings

session.set_do_comment(True, percentage=1)
session.set_comments(['aMEIzing!', 'Nicey!'])
session.set_dont_include(['friend1', 'friend2', 'friend3'])
session.set_dont_like(['pizza', 'girl'])

# do the actual liking
session.like_by_tags(['anuradhapura', 'travel'], amount=1)

# end the bot session
session.end()
Example #9
0
from instapy import InstaPy
import config
InstaPy(username=config.username, password=config.password).login()
Example #10
0
from instapy import InstaPy
from instapy import smart_run
instagram_username = ''  # <-  username here
instagram_password = ''  # <-  password here

# instapy object session
# set headless_browser=True to run InstaPy in the background
sesh = InstaPy(username=instagram_username, password=instagram_password)

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

    # set % of ppl to follow
    sesh.set_do_follow(True, percentage=50)

    #sets the % of posts you want to place comment
    sesh.set_do_comment(True, percentage=100)

    #string list of comments bot will use
    sesh.set_comments([
        "hi @{}, have a look", "Great content @{} have a look",
        ":heart_eyes: :heart_eyes: :heart_eyes: @{}"
    ])

    # set the quotas for the daily and hourly actions
    sesh.set_quota_supervisor(enabled=True,
                              peak_comments_daily=250,
                              peak_comments_hourly=30,
                              peak_likes_daily=250,
                              peak_likes_hourly=30,
Example #11
0
class instogrammAPI(threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)
        self.users_dict = dict()
        self.users_dict_comments = dict()
        # login credentials

        insta_username = '******'
        insta_password = '******'
        self.ranning = True
        self.comments = ['Nice shot! @{}',
                'I love your profile! @{}',
                'Your feed is an inspiration :thumbsup:',
                'Just incredible :open_mouth:',
                'What camera did you use @{}?',
                'Love your posts @{}',
                'Looks awesome @{}',
                'Getting inspired by you @{}',
                ':raised_hands: Yes!',
                'I can feel your passion @{} :muscle:']
        
        # get an InstaPy session!
        # set headless_browser=True to run InstaPy in the background
        self.session = InstaPy(username=insta_username,
                          password=insta_password,
                          headless_browser=False) 
        self.go_functhion = self.pass_pass
        self.change_fun = False
        self.mass_for_fun = ["", ""]
        self.output_class = None
        
    def run(self):
        with smart_run(self.session):
            while self.ranning:
                
                #print("&&", end=" ")
                if self.change_fun:
                    print("!!!run", self.mass_for_fun)
                    print("поток ", self.output_class.__class__.__name__)
                    data = self.go_functhion(*self.mass_for_fun[:-1:], trying=self.mass_for_fun[-1])
                    
                    self.change_fun = False
                    self.output_class.output_data = data
                    self.output_class.is_end = True
                    self.reverse_connect()
                    #self.mass_for_fun = ["", ""]
                    self.go_functhion = self.pass_pass
                sleep(0.2)
            print("=====")
        print("@@@@@@")
                    
    def reverse_connect(self):
        print("reverse_connect")
        if self.output_class:
            self.output_class.my_signal.closeApp.emit()
            
            
    def pass_pass(self,*a, **b):
        pass
    
    def check_like(self, username, herf_post_part, trying=False): # тут используетя в качестве  username'а имя пользователя, который хочет зарабатывать деньги
        herf = "https://www.instagram.com/p/" + herf_post_part + "/"
        print(1)
        if trying:
            like_count = self.session.my_get_count_likers(herf) # BteOBM0h6NJ
            like_count =  50 if (len(like_count) != 0) and int(like_count[0].split()[0]) > 50 else int(like_count[0].split()[0])    
            second_set = set(self.session.my_get_listLikerUser(herf, 100))
            print(list(second_set - set(self.users_dict[username][herf_post_part])))
            print(2)
            return (True if username in list(second_set - set(self.users_dict[username][herf_post_part])) else False)
        else:
            print(3)
            like_count = self.session.my_get_count_likers(herf) # BteOBM0h6NJ
            like_count =  50 if (len(like_count) != 0) and int(like_count[0].split()[0]) > 50 else int(like_count[0].split()[0])
            self.users_dict[username] = {herf_post_part : self.session.my_get_listLikerUser(herf, 100)}       #[herf_post_part] = users_dict[username].get(herf_post_part,  session.my_get_listLikerUser(herf, like_count))  
            print(4)
            
    def check_comments(self, username, herf_post_part, trying=False):# тут используетя в качестве  username'а имя пользователя, который хочет зарабатывать деньги
        herf = "https://www.instagram.com/p/" + herf_post_part + "/"
        if trying:
            comments_list = self.session.my_get_usernames_from_comments(herf, daysold=1)
            print(comments_list)
            return username in comments_list
        else:
            self.users_dict_comments[username] = {herf_post_part : self.session.my_get_usernames_from_comments(herf, daysold=1)} 
            
    def go_check_comments(self, username, herf_post_part, output_class,trying=False):
        self.mass_for_fun = [username, herf_post_part, trying]
        self.output_class = output_class
        self.go_functhion  = self.check_comments
        print('^^^^^^^')
        self.change_fun = True
        print("self.change_fun", self.change_fun)
        
        #output_class.is_end = True
        
    def go_check_like(self, username, herf_post_part, output_class, trying=False):
        self.mass_for_fun = [username, herf_post_part, trying]
        self.output_class = output_class
        self.go_functhion  = self.check_like
        print('^^^^^^^')
        self.change_fun = True
        print("self.change_fun", self.change_fun)
Example #12
0
# https://github.com/timgrossmann/InstaPy/issues/3321
# https://github.com/timgrossmann/InstaPy/issues/838
import sys
reload(sys)
sys.setdefaultencoding('utf-8')

# importing all settings from settings.json
# ----------------------->
with open('settings.json') as settings_file:
    settings = json.load(settings_file)

# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
# ------------------------------------->
session = InstaPy(username=str(settings['credentials']['username']),
                  password=str(settings['credentials']['password']),
                  headless_browser=False)

# Fire up Session!
# ------------------->
with smart_run(session):

    # Set Up Relationship Bounds
    # ------------------------------------->
    # This is used to check the number of followers and/or following a user has and if these numbers
    # either exceed the number set OR does not pass the number set OR if their ratio does not reach
    # desired potency ratio then no further interaction happens
    # ------------------------------------->
    session.set_relationship_bounds(
        enabled=True,
        # potency_ratio=1,
Example #13
0
"""
This template is written by @Tachenz

What does this quickstart script aim to do?
- Interact with user followers, liking 3 pictures, doing 1-2 comment - and 25% chance of follow (ratios which work the best for my account)

NOTES:
- This is used in combination with putting a 40 sec sleep delay after every like the script does. It runs 24/7 at rather slower speed, but without problems (so far).
"""

from instapy import InstaPy
from instapy.util import smart_run

# get a session!
session = InstaPy(username='******', password='******')

# let's go! :>
with smart_run(session):
    # settings
    # session.set_user_interact(amount=3, randomize=True, percentage=100, media='Photo')
    session.set_relationship_bounds(enabled=True,
                                    max_followers=3000,
                                    max_following=900,
                                    min_followers=5,
                                    min_following=5)
    # session.set_simulation(enabled=False)
    # session.set_do_like(enabled=True, percentage=100)
    # session.set_ignore_users([])
    # session.set_do_comment(enabled=True, percentage=35)
    # session.set_do_follow(enabled=True, percentage=25, times=1)
    # session.set_comments([])
Example #14
0
# login credentials
insta_username = ''
insta_password = ''
with open("logs/working_user.lst") as input_file:
    line = input_file.readline().strip()
    insta_username = line.split(':')[0]
    insta_password = line.split(':')[1]
    print("username :"******"password :"******""" Activity flow """
    with open("logs/target_list.lst", 'r') as input_file:
        for line in input_file:
            account = line.strip()
            if account[0] != '#':
                all_followers = session.grab_followers(username=account,
                                                       amount="full",
                                                       live_match="False",
                                                       store_locally=False)
Example #15
0
# Write your automation here
# Stuck ? Look at the github page or the examples in the examples folder

insta_username = ''
insta_password = ''

dont_like = ['food', 'girl', 'hot']
ignore_words = ['pizza']
friend_list = ['friend1', 'friend2', 'friend3']

# If you want to enter your Instagram Credentials directly just enter
# username=<your-username-here> and password=<your-password> into InstaPy
# e.g like so InstaPy(username="******", password="******")

bot = InstaPy(username=insta_username, password=insta_password, selenium_local_session=False)
bot.set_selenium_remote_session(selenium_url='http://selenium:4444/wd/hub')
bot.login()
bot.set_relationship_bounds(enabled=True,
             potency_ratio=-1.21,
              delimit_by_numbers=True,
               max_followers=4590,
                max_following=5555,
                 min_followers=45,
                  min_following=77)
bot.set_do_comment(True, percentage=10)
bot.set_comments(['Cool!', 'Awesome!', 'Nice!'])
bot.set_dont_include(friend_list)
bot.set_dont_like(dont_like)
bot.set_ignore_if_contains(ignore_words)
bot.like_by_tags(['dog', '#cat'], amount=100)
Example #16
0
#loading the .env file from the root directory
load_dotenv()

#getting the username and password from the .env file
user_name = os.getenv('user_name')
user_password = os.getenv('user_password')

#A list of accounts that we need to follow their followers
accounts_to_follow_followers = [
    'enockgraphics', 'beka_graphics', 'saydgraphy', 'shine_graphics',
    'mr_swahili'
]

session = InstaPy(username=user_name,
                  password=user_password,
                  want_check_browser=True)

with smart_run(session, threaded=True):
    session.follow_user_followers(accounts_to_follow_followers,
                                  amount=20,
                                  randomize=True,
                                  interact=False)
    session.set_quota_supervisor(enabled=True,
                                 sleep_after=[
                                     "likes", "comments_d", "follows",
                                     "unfollows", "server_calls_h"
                                 ],
                                 sleepyhead=True,
                                 stochastic_flow=True,
                                 notify_me=True,
Example #17
0
def worker(selection):
    
    print("MULTI - Started as",instaUser[selection],"at",datetime.datetime.now().strftime("%H:%M:%S"))
    session = InstaPy(username=instaUser[selection], password=instaPass[selection], headless_browser=True)
    session.login()

    session.set_dont_unfollow_active_users(enabled=True, posts=7)
    session.set_user_interact(amount=2, randomize=True, percentage=20, media='Photo')
    session.set_relationship_bounds(enabled=True,
             potency_ratio=-1.21,
              delimit_by_numbers=True,
               max_followers=4590,
                max_following=5555,
                 min_followers=45,
                  min_following=77)

    session.like_by_feed(amount=random.randint(5,11), randomize=True, unfollow=True, interact=True)
    print("MULTI -",instaUser[selection],"finished liking by feed at",datetime.datetime.now().strftime("%H:%M:%S"))

    if not followLocation[selection] == '':#if no location given for that account, just ignore this step
        session.like_by_locations(followLocation[selection], amount=10)
        print("MULTI -",instaUser[selection],"finished liking by location",datetime.datetime.now().strftime("%H:%M:%S"))

    session.unfollow_users(amount=random.randint(7,10), sleep_delay=(random.randint(44,111)))
    print("MULTI -",instaUser[selection],"finished unfollowing at",datetime.datetime.now().strftime("%H:%M:%S"))
      
    if followersToFollow[selection]:
        session.follow_user_followers(followersToFollow[selection], amount=random.randint(44,55), randomize=False, interact=True, sleep_delay=111)
        print("MULTI -",instaUser[selection],"finished following followers at",datetime.datetime.now().strftime("%H:%M:%S")) 
   
    if smartTags[selection]:
        session.set_smart_hashtags(smartTags[selection], limit=3, sort='top', log_tags=True)
        session.like_by_tags(amount=random.randint(2,5), use_smart_hashtags=True)
        print("MULTI -",instaUser[selection],"finished smartTags at",datetime.datetime.now().strftime("%H:%M:%S"))

    session.end()
    print("MULTI -",instaUser[selection],"finished run at",datetime.datetime.now().strftime("%H:%M:%S"))
Example #18
0
#!/usr/bin/env python
# coding: utf-8

# In[1]:

from instapy import InstaPy

session = InstaPy(username="******", password="******")
session.login()

session.like_by_tags(["travel", "wanderlust"], amount=5)
#session.set_dont_like(["naked", "nsfw"])
session.set_do_follow(True, percentage=50)
session.set_do_comment(True, percentage=50)
session.set_comments(["Nice!", "Sweet!"])
session.end()

# In[ ]:
Example #19
0
    while True:
        system('clear')
        print(
            '\033[1;33mExemplo: \033[1;92mmuito bom, bacana, gostei disso ai, interessante'
        )
        lista_comentarios = str(
            input('\033[1;33mDigite de 4 ou mais comentarios: \033[1;97m')
        ).split(',')
        if len(lista_comentarios) >= 4:
            break
        system('clear')
        print(
            '\033[1;33mPrecisa de \033[1;31mpelo menos 4 comentarios, separados por virgulas'
        )
    # ['Muito bom', 'Show de bola', 'Tops!', 'Bacana', 'Muito massa', '👌 Tops!', 'Tops!!', '🤘🤘','Bacana 👍','Interessante 👍', 'legal 👍', '✌️✌️']
    session = InstaPy(username=user, password=password, headless_browser=False)
    with smart_run(session):

        def commentarios(tags, lista_comentarios):
            # porcentagem de likes que realizara
            session.set_do_comment(True, percentage=100)
            # media='Video' --> define o tipo de post e marca o quem enviou o post
            session.set_comments(lista_comentarios)
            session.like_by_tags(tags,
                                 amount=5,
                                 media='Photo',
                                 skip_top_posts=True,
                                 randomize=True,
                                 interact=True)
            session.set_user_interact(
                amount=1,  # interagir com 1
Example #20
0
from instapy import InstaPy

session = InstaPy(username="******", password="******")
session.login()
Example #21
0
def createSession(username, password):
    Session = InstaPy(username,
                      password,
                      headless_browser=False,
                      multi_logs=True)
    return Session
Example #22
0
import random
from instapy import InstaPy
from instapy import smart_run

insta_username = ''
insta_password = ''

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)
    session.set_relationship_bounds(enabled=True,
                                    potency_ratio=None,
                                    delimit_by_numbers=True,
                                    max_followers=7500,
                                    max_following=5000,
                                    min_followers=300,
                                    min_following=100,
                                    min_posts=0)

    session.set_skip_users(skip_private=False,
                           skip_no_profile_pic=True,
                           skip_business=False)

    session.set_quota_supervisor(enabled=True, sleep_after=["follows","server_calls_h"], sleepyhead=True, stochastic_flow=True, notify_me=False,
                                peak_follows_hourly=48,
                                  peak_server_calls_hourly=25)
  profile visits since I use this tactic.

  As I target mainly active accounts, I use two unfollow methods. 
  The first will unfollow everyone who did not follow back within 12h.
  The second one will unfollow the followers within 24h.
"""

# !/usr/bin/python2.7
import random
from instapy import InstaPy
from instapy import smart_run

# get a session!
session = InstaPy(username='******',
                  password='******',
                  proxy_address='xxx',
                  proxy_port='xxxx',
                  headless_browser=True)

# let's go! :>
with smart_run(session):
    hashtags = [
        'travelcouples', 'travelcommunity', 'passionpassport',
        'travelingcouple', 'backpackerlife', 'travelguide', 'travelbloggers',
        'travelblog', 'letsgoeverywhere', 'travelislife', 'stayandwander',
        'beautifuldestinations', 'moodygrams', 'ourplanetdaily', 'travelyoga',
        'travelgram', 'sunsetporn', 'lonelyplanet', 'igtravel',
        'instapassport', 'travelling', 'instatraveling', 'travelingram',
        'mytravelgram', 'skyporn', 'traveler', 'sunrise', 'sunsetlovers',
        'travelblog', 'sunset_pics', 'visiting', 'ilovetravel',
        'photographyoftheday', 'sunsetphotography', 'explorenature',
from instapy import InstaPy

insta_username = '******'
insta_password = '******'

# if you want to run this script on a server,
# simply add nogui=True to the InstaPy() constructor
session = InstaPy(username=insta_username, password=insta_password,headless_browser=True,disable_image_load=True,want_check_browser=False)
session.login()

# set up all the settings
session.set_skip_users(skip_private=False,
                       private_percentage=100)
session.set_relationship_bounds(enabled=True,
				 potency_ratio=-0.21,
				  delimit_by_numbers=True,
				   max_followers=40590,
				    max_following=50555,
				     min_followers=45,
				      min_following=77)
session.set_do_follow(enabled=True, percentage=80)
session.set_do_like(True, percentage=100)
session.set_user_interact(amount=30, randomize=True, percentage=100, media='Photo')
#session.follow_by_tags(['handmadecraft','handmadekeytags','quiling','quilings','resins','resinkeytags','keychains','chains'], amount=10)

session.follow_user_followers([ 'namu_darra','agasidewni_official','shanudrie'], amount=50, randomize=False, sleep_delay=600,interact=True)


# end the bot session
session.end()
Example #25
0
"""
This template is written by @loopypanda

What does this quickstart script aim to do?
- My settings is for running InstaPY 24/7 with approximately 1400
follows/day - 1400 unfollows/day running follow until reaches 7500 and than
switch to unfollow until reaches 0.
"""

from instapy import InstaPy
from instapy import smart_run

# get a session!
session = InstaPy(username='', password='')

# let's go! :>
with smart_run(session):
    # general settings

    # session.set_relationship_bounds(enabled=True,
    # delimit_by_numbers=False, max_followers=12000, max_following=4500,
    # min_followers=35, min_following=35)
    # session.set_user_interact(amount=2, randomize=True, percentage=100,
    # media='Photo')
    session.set_do_follow(enabled=True, percentage=100)
    session.set_do_like(enabled=True, percentage=100)
    # session.set_comments(["Cool", "Super!"])
    # session.set_do_comment(enabled=False, percentage=80)
    # session.set_user_interact(amount=2, randomize=True, percentage=100,
    # media='Photo')
Example #26
0
- At the end I clean my account unfollowing all the users followed with
InstaPy.
"""

# imports
from instapy import InstaPy
from instapy import smart_run

# login credentials
insta_username = ''
insta_password = ''

# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=False)

with smart_run(session):
    # Activity flow
    # general settings
    session.set_relationship_bounds(enabled=True,
                                    delimit_by_numbers=True,
                                    max_followers=4590,
                                    min_followers=45,
                                    min_following=77)

    session.set_dont_include(["user1", "user2", "user3"])
    session.set_dont_like(["auto", "#city"])

    # activities
Example #27
0
def bot():
	try:
		session = InstaPy(username=str(username), password=str(password))  #headless_browser=True
		session.login()
		session.set_quota_supervisor(enabled=True, sleep_after=["likes", "comments_d", "follows", "unfollows", "server_calls_h"], sleepyhead=True, stochastic_flow=True, notify_me=True,
                              peak_likes_hourly=57,
                             	peak_likes_daily=585,
                              	peak_comments_hourly=21,
                              	peak_comments_daily=182,
                               	peak_follows_hourly=48,
                               	peak_follows_daily=None,
                                	peak_unfollows_hourly=35,
                                	peak_unfollows_daily=402,
                                 	peak_server_calls_hourly=None,
                                 	peak_server_calls_daily=4700)
		for i in range(20):
			session.like_by_tags([hashtag], amount=5)
			session.set_dont_like(["naked", "nsfw"])
			try:
				session.set_do_follow(True, percentage=100)
			except:
				print('Что то пошло не по плану!')
			try:
				session.set_comments(['Awesome', 'Really Cool', 'I like your stuff'])
			except:
				print('Что то пошло не по пану!')
			session.set_do_like(enabled=True, percentage=100)
	except:
		print('Возможно вы ввели некорректное имя пользователя / пароль или хэштег, удостоверьтесь, что у вас установлен Firefox(обязательно) и есть интернет-соединение и попробуйте еще раз!')
Example #28
0


# imports
from instapy import InstaPy
from instapy import smart_run
import random

# login credentials
insta_username = ''
insta_password = ''

tags= ['data','analysis','ai','ml','machinelearning','informationtechnology','java','python','roboti','programming','coding','tableau']
users = ['urdatascientist','azurewill','pure.python','xyranks','data_science_learn','data__analysis','what_the_code',]
# get a session!
session = InstaPy(username=insta_username, password=insta_password)


with smart_run(session):
    # settings
    session.set_relationship_bounds(enabled=True,
                                    max_followers=2500,max_following=2200)
    
    #use the value of `False` to permanently turn it off
    session.set_simulation(enabled=False)
    
    session.set_user_interact(amount=2, randomize=True, percentage=40)
    session.set_do_follow(enabled=True, percentage=50)
    session.set_do_like(enabled=True, percentage=80)
    
    
Example #29
0
)
parser.add_argument(
    "--to_follow",
    action="store",
    help="Follow the users of this account",
    required=True,
)
parser.add_argument(
    "--amount", action="store", help="The amount of users to follow", required=True
)
args = parser.parse_args()

instagram_login = str(args.instagram_login)
instagram_password = str(args.instagram_password)
instagram_to_follow = convert(args.to_follow)
instagram_amount = int(args.amount)

logging.info(f"{instagram_to_follow}")
assert isinstance(instagram_login, str)
assert isinstance(instagram_password, str)
assert isinstance(instagram_to_follow, list)
assert isinstance(instagram_amount, int)


session = InstaPy(username=instagram_login, password=instagram_password)

with smart_run(session):
    session.follow_user_followers(
        usernames=instagram_to_follow, amount=instagram_amount, randomize=False
    )
Example #30
0
friends = ['']

like_tag_list = [
    '30anos', '29anos', '28anos', '31anos', '27anos', '26anos', 'casa', 'work',
    'trabalho', 'workhard', 'home', 'investimento', 'capitalismo', 'casa',
    'imobiliario', 'moradia', 'porche', 'comprarcasa', 'futebol'
]

# prevent posts that contain some plantbased meat from being skipped
ignore_list = ['girl']

accounts = ['accounts with similar content']

session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True,
                  bypass_security_challenge_using='sms',
                  disable_image_load=True)

with smart_run(session):
    session.login()

    session.set_quota_supervisor(enabled=True,
                                 sleep_after=[
                                     "likes", "comments_d", "follows",
                                     "unfollows", "server_calls_h"
                                 ],
                                 sleepyhead=True,
                                 stochastic_flow=True,
                                 notify_me=True,
                                 peak_likes_hourly=57,
Example #31
0
#!/usr/bin/env python3
# imports
from instapy import InstaPy
from instapy import smart_run
from instapy import set_workspace

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

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

with smart_run(session):
    # Interacts with a certain amount of the users post
    session.set_user_interact(amount=4,
                              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=2000,
    #                                 max_following=10000,
    #                                 max_posts=300)

    # # Likes only a certain amount an hour
    # session.set_quota_supervisor(enabled=True,
    #                              sleep_after=["likes_h"],
    #    peak_likes_hourly=90)
"""
This template is written by @Edhim

What does this quickstart script aim to do?
- I am using simple settings for my personal account with a crontab each 3H,
it's been working since 5 months with no problem.
"""

from instapy import InstaPy
from instapy import smart_run

# get a session!
session = InstaPy(username='', password='')

# let's go! :>
with smart_run(session):
    # settings
    session.set_relationship_bounds(enabled=False,
                                    potency_ratio=-1.21,
                                    delimit_by_numbers=True,
                                    max_followers=4590,
                                    max_following=5555,
                                    min_followers=45,
                                    min_following=77)
    session.set_do_comment(True, percentage=50)
    session.set_comments([
        'aMazing!', 'So cool!!', 'Nice!', 'wow looks nice!', 'this is awesome!'
    ])

    # activity
    session.like_by_tags([
Example #33
0
"""Example Case of the Script"""
from instapy import InstaPy

#if you don't provide arguments, the script will look for INSTA_USER and INSTA_PW in the environment
session = InstaPy(username='******', password='******')

"""Logging in"""
#logs you in with the specified username and password
session.login()

"""Comment util"""
#default enabled=False, ~ every 4th image will be commented on
session.set_do_comment(enabled=True, percentage=25)
session.set_comments(['Awesome', 'Really Cool', 'I like your stuff'])
# you can also set comments for specific media types (Photo / Video)
session.set_comments(['Nice shot!'], media='Photo')
session.set_comments(['Great Video!'], media='Video')

"""Follow util"""
#default enabled=False, follows ~ every 10th user from the images
session.set_do_follow(enabled=True, percentage=10)

"""Image Check with Image tagging api"""
#default enabled=False , enables the checking with the clarifai api (image tagging)
#if secret and proj_id are not set, it will get the environment Variables
# 'Clarifai_SECRET' and 'CLARIFAI_ID'
session.set_use_clarifai(enabled=True, secret='xyz', proj_id='123')
#                                        ^
# ^If specified once, you don't need to add them again

session.set_use_clarifai(enabled=False)
from instapy import InstaPy
from instapy.util import smart_run

# login credentials
insta_username = '******'
insta_password = '******'

# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=False)

with smart_run(session):
    """ Activity flow """
    # general settings
    session.set_relationship_bounds(enabled=True,
                                    delimit_by_numbers=True,
                                    max_followers=4590,
                                    min_followers=45,
                                    min_following=77)

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

    # activities
    """ Massive Follow of users followers (I suggest to follow not less than
    3500/4000 users for better results)...
    """
    session.follow_user_followers(['user1', 'user2', 'user3'],
                                  amount=800,
"""Example Case of the Script"""
from instapy import InstaPy

try:
    # if you don't provide arguments, the script will look for INSTA_USER and INSTA_PW in the environment
    session = InstaPy(username='******', password='******',multi_logs=True)

    """Logging in"""
    # logs you in with the specified username and password
    session.login()

    """Comment util"""

    session.set_do_comment(enabled=True, percentage=25)
    session.set_comments(['Awesome', 'Really Cool', 'I like your stuff'])

    """Follow util"""
    # default enabled=False, follows ~ every 10th user from the images
    session.set_do_follow(enabled=True, percentage=10)

    session.set_use_clarifai(enabled=False)

    """Like util"""
    # searches the description and owner comments for the given words
    # and won't like the image if one of the words are in there
    session.set_dont_like(['food', 'eat', 'meal'])
    # will ignore the don't like if the description contains
    # one of the given words
    session.set_ignore_if_contains(['glutenfree', 'french', 'tasty'])

    """Different tasks"""
Example #36
-1
from instapy import InstaPy

# Write your automation here
# Stuck ? Look at the github page or the examples in the examples folder

insta_username = ''
insta_password = ''

dont_like = ['food', 'girl', 'hot']
ignore_words = ['pizza']
friend_list = ['friend1', 'friend2', 'friend3']

# If you want to enter your Instagram Credentials directly just enter
# username=<your-username-here> and password=<your-password> into InstaPy
# e.g like so InstaPy(username="******", password="******")

bot = InstaPy(username=insta_username, password=insta_password, selenium_local_session=False)
bot.set_selenium_remote_session(selenium_url='http://selenium:4444/wd/hub')
bot.login()
bot.set_upper_follower_count(limit=2500)
bot.set_do_comment(True, percentage=10)
bot.set_comments(['Cool!', 'Awesome!', 'Nice!'])
bot.set_dont_include(friend_list)
bot.set_dont_like(dont_like)
bot.set_ignore_if_contains(ignore_words)
bot.like_by_tags(['dog', '#cat'], amount=100)
bot.end()
Example #37
-2
"""Example Case of the Script"""
from instapy import InstaPy

# if you don't provide arguments, the script will look for INSTA_USER and INSTA_PW in the environment
session = InstaPy(username='******', password='******')

"""Logging in"""
# logs you in with the specified username and password
session.login()

"""Comment util"""
# default enabled=False, ~ every 4th image will be commented on
session.set_do_comment(enabled=True, percentage=25)
session.set_comments(['Awesome', 'Really Cool', 'I like your stuff'])
# you can also set comments for specific media types (Photo / Video)
session.set_comments(['Nice shot!'], media='Photo')
session.set_comments(['Great Video!'], media='Video')

"""Follow util"""
# default enabled=False, follows ~ every 10th user from the images
session.set_do_follow(enabled=True, percentage=10)

"""Image Check with Image tagging api"""
# default enabled=False , enables the checking with the clarifai api (image tagging)
# if secret and proj_id are not set, it will get the environment Variables
# 'CLARIFAI_API_KEY'
session.set_use_clarifai(enabled=True, api_key='xxx')
#                                        ^
# ^If specified once, you don't need to add them again

session.set_use_clarifai(enabled=False)