Guest User

Untitled

a guest
Dec 15th, 2018
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. """ Quickstart script for InstaPy usage """
  2. # imports
  3. from instapy import InstaPy
  4. from instapy.util import smart_run
  5. from random import sample
  6. from random import randint
  7. from time import sleep
  8.  
  9. # login credentials
  10. insta_username = ''
  11. insta_password = ''
  12.  
  13. blacklist = ['']
  14.  
  15. tags = ['']
  16.  
  17. locations = ['']
  18.  
  19. accounts_to_follow = ['']
  20.  
  21. def get_accounts(): 1,1 Top
  22. return sample(accounts_to_follow, 3)
  23.  
  24. def get_locations():
  25. return sample(locations, 3)
  26.  
  27. def get_likes_n_times():
  28. return randint(40, 65)
  29.  
  30. def get_tags():
  31. return sample(tags, 3)
  32.  
  33. def get_follow_n_times():
  34. return randint(50, 79)
  35.  
  36. def get_random_sleep():
  37. return randint(60, 440)
  38.  
  39. def get_unfollow_n_times():
  40. return randint(48, 67)
  41.  
  42. # get an InstaPy session!
  43. # set headless_browser=True to run InstaPy in the background
  44. session = InstaPy(username=insta_username,
  45. password=insta_password,
  46. headless_browser=True,
  47. use_firefox=True,
  48. proxy_address='',
  49. proxy_port=3128,
  50. bypass_suspicious_attempt=True)
  51.  
  52. with smart_run(session):
  53. # general settings
  54. session.set_skip_users(skip_private=False,
  55. private_percentage=100)
  56. session.set_relationship_bounds(enabled=True,
  57. delimit_by_numbers=True,
  58. max_followers=7590,
  59. min_followers=200,
  60. min_following=50)
  61. session.set_dont_include(blacklist)
  62. # activity
  63. session.like_by_locations(get_locations(), amount=get_likes_n_times(), skip_top_posts=False)
  64. sleep(get_random_sleep())
  65. session.follow_user_followers(get_accounts_to_follow(), amount=get_follow_n_times(), randomize=True)
  66. sleep(get_random_sleep())
  67. session.set_user_interact(amount=2, percentage=70, randomize=True, media='Photo')
  68. session.follow_likers(get_accounts(), photos_grab_amount=10, follow_likers_per_photo=20, randomize=True, sleep_delay=600, interact=True)
  69. sleep(get_random_sleep())
  70. session.follow_user_followers(get_accounts_to_follow(), amount=get_follow_n_times(), randomize=True)
  71. sleep(get_random_sleep())
  72. session.follow_user_followers(get_accounts_to_follow(), amount=get_follow_n_times(), randomize=True)
Add Comment
Please, Sign In to add comment