Guest User

Untitled

a guest
Oct 2nd, 2020
7,723
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ZoF
  2. import os
  3. try:
  4. import requests
  5. except ImportError:
  6. os.system("pip install requests")
  7. import requests
  8. from time import sleep
  9. import re
  10. ig_did = ''
  11. csrftoken = ''
  12. sessionid = ''
  13. post_id = ''
  14. done = 0
  15. wait = 0
  16. error = 0
  17. r1 = requests.session()
  18. def welcome():
  19. print("""
  20.  
  21. _______ _______ _______ _______ _______ _ _________ ______ _______ _________
  22. ( ____ \( ___ )( )( )( ____ \( ( /|\__ __/ ( ___ \ ( ___ )\__ __/
  23. | ( \/| ( ) || () () || () () || ( \/| \ ( | ) ( | ( ) )| ( ) | ) (
  24. | | | | | || || || || || || || (__ | \ | | | | | (__/ / | | | | | |
  25. | | | | | || |(_)| || |(_)| || __) | (\ \) | | |@x4xeo | | | | | | |
  26. | | | | | || | | || | | || ( | | \ | | | | ( \ \ | | | | | |
  27. | (____/\| (___) || ) ( || ) ( || (____/\| ) \ | | | | )___) )| (___) | | |
  28. (_______/(_______)|/ \||/ \|(_______/|/ )_) )_( |/ \___/ (_______) )_(
  29.  
  30. """)
  31. print("Programmed By #Modx/@x4xeo")
  32. welcome()
  33. def close_bot():
  34. input("Enter To Close..")
  35. exit(0)
  36. def login():
  37. global ig_did, csrftoken, sessionid
  38. username = input("[?] Username : ")
  39. password = input("[?] Password : ")
  40. login_url = 'https://www.instagram.com/accounts/login/ajax/'
  41. login_headers = {
  42. 'accept': '*/*',
  43. 'accept-encoding': 'gzip, deflate, br',
  44. 'accept-language': 'en-US,en;q=0.9',
  45. 'content-length': '275',
  46. 'content-type': 'application/x-www-form-urlencoded',
  47. 'cookie': 'ig_did=303991DA-0420-41AC-A26D-D9F27C8DF624; mid=X0padwAEAAEPS5xI4RZu1YV6z7zS; rur=ASH; csrftoken=xX0K5q7XikrU1LAnenqEVKqb7J3qK4S6; urlgen="{\"185.88.26.35\": 201031}:1kC1CG:D41DVXmf-j-T5nYho3c7g7K3MQU"',
  48. 'origin': 'https://www.instagram.com',
  49. 'referer': 'https://www.instagram.com/',
  50. 'sec-fetch-dest': 'empty',
  51. 'sec-fetch-mode': 'cors',
  52. 'sec-fetch-site': 'same-origin',
  53. 'user-agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36',
  54. 'x-csrftoken': 'xX0K5q7XikrU1LAnenqEVKqb7J3qK4S6',
  55. 'x-ig-app-id': '936619743392459',
  56. 'x-ig-www-claim': 'hmac.AR3tv9HzzLkZIUlGMRu3lzHfEeePw9CgWg8cuXGO22LfU8x0',
  57. 'x-instagram-ajax': '0c15f4d7d44a',
  58. 'x-requested-with': 'XMLHttpRequest'
  59. }
  60. login_data = {
  61. 'username': f'{username}',
  62. 'enc_password': f'#PWD_INSTAGRAM_BROWSER:0:1589682409:{password}',
  63. 'queryParams': '{}',
  64. 'optIntoOneTap': 'false'
  65. }
  66. login_to_acc = r1.post(login_url, data=login_data, headers=login_headers)
  67. if login_to_acc.content == b'{"user": false, "authenticated": false, "status": "ok"}':
  68. print("[!] Check Your Username And Try Again")
  69. close_bot()
  70. if login_to_acc.content == b'{"user": true, "authenticated": false, "status": "ok"}':
  71. print("[!] Check Yo Password And Try Again")
  72. close_bot()
  73. if ('{"message": "checkpoint_required"') in login_to_acc.text:
  74. print("[!] Checkpoint")
  75. close_bot()
  76. if 'userId' in login_to_acc.text:
  77. print("[+] Login Done")
  78. else:
  79. print("[!] Check Your Acc And Try Again")
  80. close_bot()
  81. ig_did = login_to_acc.cookies['ds_user_id']
  82. csrftoken = login_to_acc.cookies['csrftoken']
  83. sessionid = login_to_acc.cookies['sessionid']
  84. login()
  85. def get_post_id():
  86. global post_id
  87. post_url = input("[?] Post Url = ")
  88. post_id_url = post_url+'?__a=1'
  89. try_to_get_post_id = r1.get(post_id_url).text
  90. hmmmm = re.findall('"GraphImage","id":"(.*?)"', try_to_get_post_id)
  91. post_id = " ".join(hmmmm)
  92. get_post_id()
  93. def add():
  94. global error,done,wait
  95. comment_url = f'https://www.instagram.com/web/comments/{post_id}/add/'
  96. head = {
  97. 'accept': '*/*',
  98. 'accept-encoding':'gzip, deflate, br',
  99. 'accept-language': 'en-US,en;q=0.9',
  100. 'content-length': '47',
  101. 'content-type': 'application/x-www-form-urlencoded',
  102. 'origin': 'https://www.instagram.com',
  103. 'referer': 'https://www.instagram.com/p/CFM5P9BnlyY/',
  104. 'sec-fetch-dest': 'empty',
  105. 'sec-fetch-mode': 'cors',
  106. 'sec-fetch-site': 'same-origin',
  107. 'user-agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36',
  108. 'x-csrftoken': csrftoken,
  109. 'x-ig-app-id': '936619743392459',
  110. 'x-ig-www-claim': 'hmac.AR1c2rpKOfs9PQJlx-EoLF4rQ-K0DMnVj3wLf3_HpJyvGxyY',
  111. 'x-instagram-ajax': 'a1de4804d095',
  112. 'x-requested-with': 'XMLHttpRequest'
  113. }
  114. comment = input("[?] Comment : ")
  115. sl = int(input("[?] Sleep :"))
  116. data = {
  117. 'comment_text': comment,
  118. 'replied_to_comment_id':''
  119. }
  120. os.system("cls")
  121. welcome()
  122. while True:
  123. post_comment = r1.post(comment_url,headers=head,data=data)
  124. if post_comment.status_code == 200:
  125. done +=1
  126. elif post_comment.status_code == 429:
  127. wait +=1
  128. else:
  129. error +=1
  130. print(f"\rDone = {done} Spam = {wait} Error = {error}",end="")
  131. sleep(sl)
  132. add()
RAW Paste Data