Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from instapy import InstaPy
- from random import sample, randint
- insta_username = ''
- insta_password = ''
- # set headless_browser=True if you want to run InstaPy on a server
- try:
- session = InstaPy(username=insta_username,
- password=insta_password,
- headless_browser=False)
- session.login()
- def get_like_n_times():
- return randint(20, 35)
- def get_unfollow_n_times():
- return randint(20, 30)
- def get_follow_n_times():
- return randint(25, 40)
- def get_random_sleep_delay():
- return randint(45, 140)
- # settings
- tags = [
- 'deporte', 'entrenamiento', 'vidasana', 'ejercicio', 'correr',
- 'entrenar', 'salud', 'nutricion', 'triatlon', 'juegosolimpicos',
- 'gimnasio', 'motivacion', 'deportes', 'adelgazar', 'reto',
- 'ejercicios', 'vidasaludable', 'bienestar', 'saludable', 'olimpiadas',
- 'barranquilla', 'ejercicio', 'entrenamiento', 'entrenar', 'adelgazar',
- 'salud', 'bajardepeso', 'gimnasio', 'sentadillas', 'vidasana',
- 'abdominales', 'cuerpo', 'resultados', 'saludable', 'vidasaludable',
- 'belleza', 'baby', 'familia'
- ]
- competitors = [
- 'territorio27', 'policortez'
- ]
- # select 3 tags from the tags list
- tags = sample(set(tags), 3)
- # actions
- # this setting is to avoid unused accounts
- # (profile with less than 100 followers)
- session.set_lower_follower_count(limit=100)
- session.set_do_follow(enabled=True, percentage=35, times=1)
- session.like_by_tags(tags, amount=get_like_n_times())
- session.unfollow_users(amount=get_unfollow_n_times(),
- onlyNotFollowMe=True,
- sleep_delay=get_random_sleep_delay())
- session.follow_user_followers(competitors,
- amount=get_follow_n_times(),
- random=True)
- # active it in next week or if you´re running the bot less than
- # 3 times a day
- '''
- session.like_by_tags(tags, amount=get_like_n_times())
- session.unfollow_users(amount=get_unfollow_n_times(),
- onlyNotFollowMe=True,
- sleep_delay=get_random_sleep_delay())
- session.follow_user_followers(competitors,
- amount=get_follow_n_times(),
- random=True)
- '''
- session.end()
- finally:
- # end the bot session
- session.end()
Add Comment
Please, Sign In to add comment