Advertisement
Guest User

Untitled

a guest
Apr 8th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.37 KB | None | 0 0
  1. from instabot import Bot
  2. import time
  3. import datetime
  4.  
  5. from random import randint
  6.  
  7. bot = Bot(filter_private_users=False,
  8.           min_likes_to_like=3,
  9.           max_likes_to_like=120,
  10.           max_followers_to_follow=1000,
  11.           max_following_to_follow=1200,
  12.           max_following_to_followers_ratio=8,
  13.           max_followers_to_following_ratio=3)
  14. bot.login(username="user", password="******")
  15.  
  16. #users_stream = ["iampapihans", "virgogotsauce", "dim4ous", "borobachkadosta", "ndoe_drs", "stefosnikatotnos"]
  17. comments = ["Страхотно 👌🎍😍", "Супер 😋", "Eхaa ❤", "Яко 😋", "❤❤❤", "Харесвам 👍", "👍", "😋😋", "❤", "👌", "👌👌", "Eha 👌👌👌", "Goood 👍", "Top 🔝", "🔝🔝🔝", "🔝🔝", "🔝👌"]
  18.  
  19. #user_to_sniff = "virgogotsauce"
  20. #users_to_get = 1000
  21.  
  22. users_to_skip = 0
  23.  
  24. total_followed_users = 0
  25. total_followed_users_per_hour = 0
  26. total_users_to_follow = 200
  27. total_users_to_follow_per_hour = 25
  28.  
  29. unfollowed_user_pointer = -1
  30.  
  31. rounds_count = 0
  32.  
  33. now = datetime.datetime.now()
  34. currOur = now.hour
  35.  
  36. total_liked = 0
  37.  
  38. #followers = bot.get_user_followers(user_to_sniff, users_to_get + users_to_skip)
  39.  
  40. followers = open("list.txt", "r").read().split(',')
  41.  
  42. for follower in followers:
  43.     now = datetime.datetime.now()
  44.     if(currOur  != now.hour):
  45.         total_followed_users_per_hour = 0
  46.         currOur = now.hour
  47.     if(rounds_count >= users_to_skip):
  48.         print("User index: " + str(rounds_count))
  49.         user_media = bot.get_user_medias(follower)
  50.         if(len(user_media) > 1):
  51.             media_index_to_like = randint(0, 1)
  52.             media_like_result = bot.like(user_media[media_index_to_like])
  53.             if(media_like_result):
  54.                 # if(randint(0, 4) > 3):
  55.                 #     comment_result = bot.comment(user_media[media_index_to_like], comments[randint(0, len(comments) - 1)])
  56.                 #     if(comment_result):
  57.                 #         print("Commented!")
  58.                 total_liked += 1
  59.                 time.sleep(randint(5, 12))
  60.  
  61.             if(total_followed_users < total_users_to_follow and total_followed_users_per_hour < total_users_to_follow_per_hour):
  62.                 follow_user_result = bot.follow(follower)
  63.                 if(follow_user_result):
  64.                     total_followed_users += 1
  65.                     total_followed_users_per_hour += 1
  66.                     time.sleep(randint(90, 160))
  67.                 follow_user_result = False
  68.  
  69.         has_longer_pause = False
  70.         time_to_pause = randint(5, 30)
  71.         if(time_to_pause > 39):
  72.             has_longer_pause = True
  73.             time_to_pause = randint(120, 180)
  74.             time.sleep(time_to_pause)
  75.             print("MEDIUM PAUSE: " + str(time_to_pause / 60.0) + " mins")
  76.         else:
  77.             time.sleep(time_to_pause)
  78.        
  79.         time.sleep(randint(3, 15))
  80.  
  81.         if(randint(1, 200) > 198 and has_longer_pause == False):
  82.             pause_length = randint(180, 600)
  83.             print("BIG PAUSE: " + str(pause_length / 60.0) + " mins")
  84.             time.sleep(pause_length)
  85.  
  86.         if(total_followed_users % 3 == 0 and unfollowed_user_pointer < total_followed_users ):
  87.             unfollowed_user_pointer = total_followed_users
  88.             bot.unfollow_non_followers(1)
  89.             time.sleep(randint(15, 60))
  90.         print ("Loop")
  91.     rounds_count += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement