Advertisement
Br1in

Untitled

Feb 20th, 2021
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.96 KB | None | 0 0
  1. import requests, uuid, time
  2. id = ''
  3. user = ''
  4. username = ''
  5. print(“””
  6.  
  7. ____ ______ __
  8. | _ \ ____|____ /_ |
  9. | |_) |_ _ / __ \ / / | | ___ ___
  10. | _ <| | | | / / _` | / / | |/ _ \ / __|
  11. | |_) | |_| | | | (_| |/ / | | (_) | (__
  12. |____/ \__, | \ \__,_/_/ |_|\___/ \___|
  13. __/ | \____/
  14. |___/
  15.  
  16. “””)
  17. username = input("[US] Username : ")
  18. password = input("[PS] Password : ")
  19. MySle = int(input("[SP] Sleep : "))
  20. uid = str(uuid.uuid4())
  21. head = {
  22. 'User-Agent': 'Instagram 93.1.0.19.102 Android (21/5.0.2; 240dpi; 540x960; samsung; SM-G530H; fortuna3g; qcom; ar_AE; 154400379)',
  23. "Accept": "*/*",
  24. "Accept-Encoding": "gzip, deflate",
  25. "Accept-Language": "en-US",
  26. "X-IG-Capabilities": "3brTvw==",
  27. "X-IG-Connection-Type": "WIFI",
  28. "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
  29. 'Host': 'i.instagram.com'
  30. }
  31. headweb = {
  32. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0',
  33. "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
  34. "Upgrade-Insecure-Requests": "1",
  35. "Accept-Language": "en-US,en;q=0.5",
  36. 'Host': 'www.instagram.com'
  37. }
  38.  
  39.  
  40. def get_challenge_choices(last_json):
  41. choices = []
  42.  
  43. if last_json.get("step_name", "") == "select_verify_method":
  44. choices.append("[+] Challenge received")
  45. if "phone_number" in last_json["step_data"]:
  46. choices.append("[+] 0 - Phone")
  47. if "email" in last_json["step_data"]:
  48. choices.append("[+] 1 - Email")
  49.  
  50. if last_json.get("step_name", "") == "delta_login_review":
  51. choices.append("[+] Login attempt challenge received")
  52. choices.append("[+] 0 - It was me")
  53. choices.append("[+] 0 - It wasn't me")
  54.  
  55. if not choices:
  56. choices.append(
  57. '"{}" challenge received'.format(last_json.get("step_name", "Unknown"))
  58. )
  59. choices.append("[+] 0 - Default")
  60.  
  61. return choices
  62.  
  63.  
  64. def challange(login_json):
  65. global coo
  66. challenge_url = 'https://i.instagram.com/api/v1/' + login_json["challenge"]["api_path"][1:]
  67. try:
  68. b = requests.get(challenge_url, headers=head, cookies=coo)
  69. except Exception as e:
  70. print("solve_challenge; {}".format(e))
  71. return False
  72. choiccc = get_challenge_choices(b.json())
  73. for choice in choiccc:
  74. print(choice)
  75. code = input("[+] Enter Email Or Phone : ")
  76. data_c = {
  77. 'choice': code,
  78. '_uuid': uid,
  79. '_uid': uid,
  80. '_csrftoken': 'missing'
  81. }
  82. send_c = requests.post(challenge_url, data=data_c, headers=head, cookies=coo)
  83. print("[+] Done sent Code To {}".format(send_c.json()['step_data']['contact_point']))
  84. code = input("[+] Enter Code : ").strip()
  85. data_co = {
  86. 'security_code': code,
  87. '_uuid': uid,
  88. '_uid': uid,
  89. '_csrftoken': 'missing'
  90. }
  91. send_o = requests.post(challenge_url, data=data_co, headers=head, cookies=coo)
  92. send_coj = send_o.json()
  93. if ('logged_in_user') in send_coj:
  94. 'Logged in :)'
  95. coo = send_o.cookies
  96. getid()
  97. return True
  98. return False
  99.  
  100.  
  101. unfollow = 0
  102.  
  103.  
  104. def getid():
  105. global coo
  106. global id
  107. global idme
  108. global unfollow
  109. global user
  110. a = -1
  111. urlacc = "https://www.instagram.com/" + username + "/?__a=1&include_reel=true"
  112. tx = requests.get(urlacc, headers=headweb, cookies=coo).json()
  113. idme = str(tx['graphql']['user']['id'])
  114. urlacc = f"https://i.instagram.com/api/v1/friendships/{idme}/following/?includes_hashtags=true&search_surface=follow_list_page&query=&enable_groups=true&rank_token={uid}"
  115. while True:
  116. get_id = requests.post(urlacc, headers=head, cookies=coo)
  117. try:
  118. if ("pk") in get_id.text:
  119. a += 1
  120. ends = str(get_id.json()["users"][a]['pk'])
  121. user = str(get_id.json()["users"][a]['username'])
  122. elif ("Please wait a few minutes before you try again.") in get_id.text:
  123. print("[+] Please Wait 10Min")
  124. time.sleep(600)
  125. else:
  126. print("[+] Done Delete All Following")
  127. input("")
  128. exit()
  129. exit(0)
  130. urlii = f"https://i.instagram.com/api/v1/friendships/{ends}/following/?includes_hashtags=true&search_surface=follow_list_page&query=&enable_groups=true&rank_token={uid}"
  131. CheckMe = requests.post(urlii, headers=head, cookies=coo)
  132. if (username) in CheckMe.text:
  133. print(f"[+] @{user} is Following You")
  134. else:
  135. urlun = f"https://i.instagram.com/api/v1/friendships/destroy/{ends}/"
  136. t = requests.post(urlun, headers=head, cookies=coo)
  137. if t.text.find("ok") >= 0:
  138. unfollow += 1
  139. a -= 1
  140. print(f"[+] @{user} isn't Following You > {unfollow}")
  141. time.sleep(MySle)
  142. else:
  143. print(f"\r[+] Error Remove > @{user}", end='')
  144. time.sleep(160)
  145. except:
  146. get_id = requests.post(urlacc, headers=head, cookies=coo)
  147. a = 0
  148.  
  149. def login():
  150. global head
  151. global coo
  152. login_url = "https://i.instagram.com/api/v1/accounts/login/"
  153. data_login = {'uuid': uid,
  154. 'password': password,
  155. 'username': username,
  156. 'device_id': uid,
  157. 'from_reg': 'false',
  158. '_csrftoken': 'missing',
  159. 'login_attempt_count': '0'}
  160. loginc = requests.post(login_url, data=data_login, headers=head)
  161. login1 = loginc.text
  162. if ('"logged_in_user"') in login1:
  163. coo = loginc.cookies
  164. getid()
  165.  
  166. elif ('checkpoint_challenge_required') in login1:
  167. coo = loginc.cookies
  168. return challange(loginc.json())
  169. else:
  170. print(login1)
  171.  
  172.  
  173. login()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement