Advertisement
Guest User

Request Acceptor for insta python3

a guest
Oct 12th, 2018
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.23 KB | None | 0 0
  1. from InstagramAPI import InstagramAPI
  2. import random
  3. import time
  4.  
  5. ## you will need this api for python3 https://github.com/LevPasha/Instagram-API-python
  6. global req_ids
  7. req_ids = []
  8.  
  9. print("I apologize but this version does not accept 2FA HOWEVER")
  10. print("I advice you turning it back on after running program")
  11. print("if the source code is not provided wherever you got this program it may be a trap - ~Jun")
  12. user = input("What is your username: ")
  13. passs = input("What is your pass: ")
  14.  
  15. API = InstagramAPI(user,passs)
  16.  
  17. API.login()
  18.  
  19. def getreq():
  20.     API.getPendingFollowRequests()
  21.     API.LastJson
  22.     req_users = []
  23.     #print(unformatedreq)
  24.     next_max_id = True
  25.     while next_max_id:
  26.     # first iteration hack
  27.         if next_max_id is True:
  28.             next_max_id = ''
  29.         _ = API.getPendingFollowRequests()
  30.         req_users.extend(API.LastJson.get('users', []))
  31.         next_max_id = API.LastJson.get('next_max_id', '')
  32.     unique_req = {
  33.         f['pk']: f
  34.         for f in req_users
  35.     }
  36.  
  37.  
  38.     for s in unique_req:
  39.         req_ids.append(s)
  40.         pass
  41.  
  42. getreq()
  43. API.follow("9006188352") #Comment this out if you dont wanna follow me :p (put a # in front)
  44. i = len(req_ids)
  45. print("You have a total of: " + str(i) + " requests")
  46.  
  47. a = input("How many requests would you like to accept: ")
  48. accept_requests = int(a)
  49.  
  50. def acceptreq(numaccept):
  51.     print("Begun accepting "+ str(numaccept) +" requests")
  52.     print("If you would like to stop at anytime please press CTRL-C")
  53.     print("If you would like to donate or support me feel free to donate")
  54.     print("Cash app - $pandev (Silly someone tried charging $40 for this)")
  55.     print("Alternatively you could also give me a shoutout on insta @dailyhappydogs")
  56.     r = 0
  57.  
  58.     for x in req_ids:
  59.         if r < numaccept:
  60.  
  61.             randnum = random.randint(10,300) #wait between x seconds and x seconds
  62.             API.approve(x)
  63.             r += 1
  64.             print("Just completed "+ str(r) + " requests")
  65.             print("going to sleep for: "+ str(randnum) + " seconds")
  66.             time.sleep(randnum)
  67.             print("Done sleeping moving on to next")
  68.  
  69.  
  70.         else:
  71.             break #program will end once you reach the number of requests you want to accept
  72.        
  73.  
  74. acceptreq(accept_requests)
  75.  
  76.  
  77. print("successfully accepted "+a+" requests ")
  78. print("Have a great day hope this little thing worked well")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement