Advertisement
A_GUES

Python instagram follow

Jun 23rd, 2023 (edited)
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. # imports
  2. from instapy import InstaPy
  3. from instapy import smart_run
  4.  
  5. # login credentials
  6. insta_username = 'your_username'  # <--- enter your username here
  7. insta_password = 'your_password'  # <--- enter your password here
  8.  
  9. # get an InstaPy session!
  10. # set headless_browser=True to run InstaPy in the background
  11. session = InstaPy(username=insta_username,
  12.                   password=insta_password,
  13.                   headless_browser=False)
  14.  
  15. with smart_run(session):
  16.     """ Activity flow """
  17.     # general settings
  18.     session.set_relationship_bounds(enabled=True,
  19.                                     delimit_by_numbers=True,
  20.                                     max_followers=4600,
  21.                                     min_followers=45,
  22.                                     min_following=77)
  23.  
  24.     session.set_dont_include(["friend1", "friend2", "friend3"])
  25.     session.set_dont_like(["pizza", "#store"])
  26.  
  27.     # activity
  28.     session.like_by_tags(["natgeo"], amount=10)
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement