Advertisement
6g7r

follow Requests

Apr 9th, 2021
1,058
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.83 KB | None | 0 0
  1. import requests, uuid, secrets, json
  2. from time import sleep
  3. from colorama import Fore
  4. hdid = {
  5. "Host": "www.instagram.com",
  6. "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8",
  7. "Cookie": "csrftoken=missing; sessionid=missing; mid=missing",
  8. "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 14_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.1 Mobile/15E148 Safari/604.1",
  9. "Accept-Language": "en-us",
  10. "Accept-Encoding": "gzip, deflate, br",
  11. "Connection": "keep-alive"
  12. }
  13.  
  14. r = requests.session()
  15. print("""
  16.  
  17. ██████╗ ██████╗███████╗██████╗
  18. ██╔════╝ ██╔════╝╚════██║██╔══██╗
  19. ███████╗ ██║ ███╗ ██╔╝██████╔╝
  20. ██╔═══██╗██║ ██║ ██╔╝ ██╔══██╗
  21. ╚██████╔╝╚██████╔╝ ██║ ██║ ██║
  22. ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
  23.  
  24.  
  25. """)
  26. user = input('Username : ')
  27. password = input('password : ')
  28. sle = int(input("sleep ?:"))
  29. def login():
  30. global hdid
  31. url_login = 'https://www.instagram.com/accounts/login/ajax/'
  32. headers_login = {
  33. "Accept": "/",
  34. "Accept-Encoding": "gzip, deflate, br",
  35. "Accept-Language": "en-US,en;q=0.5",
  36. "Content-Length": "267",
  37. "Content-Type": "application/x-www-form-urlencoded",
  38. "Cookie": "missing",
  39. "Host": "www.instagram.com",
  40. "Origin": "https://www.instagram.com/",
  41. "Referer": "https://www.instagram.com/",
  42. "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0",
  43. "X-CSRFToken": "missing",
  44. "X-IG-App-ID": "936619743392459",
  45. "X-IG-WWW-Claim": "0",
  46. "X-Instagram-AJAX": "a57770cf770b",
  47. "X-Requested-With": "XMLHttpRequest"
  48. }
  49. data_login = {
  50. 'username': user,
  51. 'enc_password': f'#PWD_INSTAGRAM_BROWSER:0:1589682409:{password}',
  52. 'queryParams':'{}',
  53. 'optIntoOneTap':'false'
  54.  
  55. }
  56. req = requests.post(url_login,headers=headers_login,data=data_login)
  57. if ("userId") in req.text:
  58. print('Done login ! > : ')
  59. reqid = requests.get(f'https://instagram.com/{user}/?__a=1', headers=hdid)
  60. id = json.loads(reqid.text)["graphql"]["user"]["id"]
  61. url1 = 'https://www.instagram.com/accounts/set_private/'
  62. headers2 = {
  63. 'Accept': '*/*',
  64. 'Accept-Encoding': 'gzip, deflate, br',
  65. 'Accept-Language': 'ar,en-US;q=0.7,en;q=0.3',
  66. 'Connection': 'keep-alive',
  67. 'Content-Length': '16',
  68. 'Content-Type': 'application/x-www-form-urlencoded',
  69. 'Cookie': f'mid=YG-TiwALAAE2ks16hlE80Wi1oYTc; ig_did=CF89BCF1-054E-46DB-98B6-A1B025A7597C; ig_nrcb=1; rur=FTW; shbid=7843; shbts=1617925079.6532674; csrftoken=JyZhm9whGTrh18py604FBZDPWa7pG6j7; ds_user_id={id}; sessionid={id}%3AMSVaPjB4yrds8K%3A22',
  70. 'Host':'www.instagram.com',
  71. 'Origin':'https://www.instagram.com',
  72. 'Referer':'https://www.instagram.com/accounts/privacy_and_security/',
  73. 'TE':'Trailers',
  74. 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0',
  75. 'X-CSRFToken':'JyZhm9whGTrh18py604FBZDPWa7pG6j7',
  76. 'X-IG-App-ID':'936619743392459',
  77. 'X-IG-WWW-Claim':'hmac.AR0PgHlJ-bCUiS-TTDbxUCGD0oOf2mSo5aRkGfixmRD0GULS',
  78. 'X-Instagram-AJAX':'1e298a12d662',
  79. 'X-Requested-With':'XMLHttpRequest',
  80.  
  81. }
  82.  
  83. data2 = {
  84.  
  85.  
  86. 'is_private':"false"
  87. }
  88. url12 = 'https://www.instagram.com/accounts/set_private/'
  89.  
  90.  
  91. headers22 = {
  92. 'Accept': '*/*',
  93. 'Accept-Encoding': 'gzip, deflate, br',
  94. 'Accept-Language': 'ar,en-US;q=0.7,en;q=0.3',
  95. 'Connection': 'keep-alive',
  96. 'Content-Length': '15',
  97. 'Content-Type': 'application/x-www-form-urlencoded',
  98. 'Cookie': f'mid=YG-TiwALAAE2ks16hlE80Wi1oYTc; ig_did=CF89BCF1-054E-46DB-98B6-A1B025A7597C; ig_nrcb=1; rur=FTW; shbid=7843; shbts=1617925079.6532674; csrftoken=JyZhm9whGTrh18py604FBZDPWa7pG6j7; ds_user_id={id}; sessionid={id}%3AMSVaPjB4yrds8K%3A22',
  99. 'Host': 'www.instagram.com',
  100. 'Origin': 'https://www.instagram.com',
  101. 'Referer': 'https://www.instagram.com/accounts/privacy_and_security/',
  102. 'TE': 'Trailers',
  103. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:83.0) Gecko/20100101 Firefox/83.0',
  104. 'X-CSRFToken': 'JyZhm9whGTrh18py604FBZDPWa7pG6j7',
  105. 'X-IG-App-ID': '936619743392459',
  106. 'X-IG-WWW-Claim': 'hmac.AR0PgHlJ-bCUiS-TTDbxUCGD0oOf2mSo5aRkGfixmRD0GULS',
  107. 'X-Instagram-AJAX': '1e298a12d662',
  108. 'X-Requested-With': 'XMLHttpRequest',
  109.  
  110. }
  111. data22 = {
  112.  
  113. 'is_private': "true"
  114. }
  115. done = 1
  116. error = 1
  117. while True:
  118. sleep(60)
  119. req2 = requests.post(url1,headers=headers2,data=data2)
  120. if ("Please wait a few minutes before you try again.") in req2.text:
  121. print('Error ! > : ',done)
  122. done += 1
  123. if ("ok") in req2.text:
  124. print('Done ! ',done)
  125. done += 1
  126. sleep(2)
  127. req3 = requests.post(url12,headers=headers22,data=data22)
  128. if ("Please wait a few minutes before you try again.") in req3.text:
  129. print('Error private ! > : ',error)
  130. error += 1
  131.  
  132. else:
  133. print('Done private ! > : ',error)
  134. done += 1
  135.  
  136. login()
  137.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement