Guest User

ХРОМ 5к1 UBLOCK

a guest
Jan 26th, 2022
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.36 KB | None | 0 0
  1. '''
  2. Гайд по установке
  3. Установленный python 3.7+(если будет время потом скомпилирую,или скомпилируй ты анонче)
  4. потом в терминал
  5. pip install requests
  6. pip install selenium
  7. pip install webdriver-manager
  8.  
  9. Нихуя не надо, просто запускай.
  10.  
  11. Вроде прокси не требуются,ну если возникли проблемы с регой - юзай впн
  12.  
  13. По всем вопросам,багам в тред
  14. КТО БУДЕТ ПИСАТЬ СООБЩЕНИЯ ПО ТИПУ - "КОКОКО ГОВНОКОД","ХРЮХРЮХРЮ ПИТОН";Просьба пойти срать на хабр
  15. Удачного вечера анон!
  16. '''
  17.  
  18. import requests
  19. import string,random,time,re
  20. import warnings
  21. import uuid
  22. from selenium import webdriver
  23. from webdriver_manager.chrome import ChromeDriverManager
  24. warnings.filterwarnings("ignore")
  25.  
  26. banner = """
  27. +-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+ +-+-+-+-+-+
  28. |O|P|E|R|A|T|I|O|N| |B|L|A|C|K| |M|A|M|B|A|
  29. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  30. |B|y| |A|n|o|n| |f|o|r| |2|c|h|.|h|k|
  31. +-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+
  32. |V|e|r| |1|.|2|b|
  33. +-+-+-+ +-+-+-+-+
  34. """
  35. class Post_shift():
  36.  
  37. postshift_api_hash = ""
  38. mail = {"email":"","key":""}
  39. def __generate_random_string(self,min: int = 12, max: int = 16):
  40. return ''.join(random.choice(string.ascii_lowercase) for i in range(random.randint(min, max)))
  41.  
  42. #не исользуется(защита от дебилов)
  43. def Regestration(self):
  44. try:
  45. resp = requests.get(f"https://post-shift.ru/api.php?action=reg&email={self.__generate_random_string()}@domain.ru")
  46. if resp.status_code != 200:
  47. raise Exception
  48. return True
  49. except Exception as e:
  50. print(f"Ошибка при регистрации на postshift!!!\nЛог:{e}")
  51. return False
  52.  
  53. def CreateMail(self):
  54. try:
  55. # resp = requests.get(f"https://post-shift.ru/api.php?action=new&hash={self.postshift_api_hash}")
  56. resp = requests.post(f"https://api.mail.tm/accounts")
  57. if resp.status_code != 200:
  58. raise Exception
  59. resp = resp.json()
  60. self.mail["email"] = resp["email"]
  61. self.mail["key"] = resp["key"]
  62. return True
  63. except Exception as e:
  64. print(f"Ошибка при получении ящика!!!\nЛог:{e}")
  65. return False
  66.  
  67. def Clear(self):
  68. try:
  69. resp = requests.get(f"https://post-shift.ru/api.php?action=deleteall")
  70. if resp.status_code != 200:
  71. raise Exception
  72. return True
  73. except Exception as e:
  74. print(f"Ошибка при Удалении ящиков!!!\nЛог:{e}")
  75. return False
  76.  
  77. def getEmailMessage(self, token):
  78. resp = requests.get('https://api.mail.tm/messages', headers={'Authorization': 'Bearer ' + token})
  79. if resp.status_code != 200:
  80. raise Exception
  81. emails = resp.json()['hydra:member']
  82. if len(emails) != 0:
  83. id = emails[0]['id']
  84. resp = requests.get('https://api.mail.tm/messages/' + id, headers={'Authorization': 'Bearer ' + token})
  85. if resp.status_code != 200:
  86. raise Exception
  87. return resp.json()['html'][0]
  88. return None
  89.  
  90.  
  91. def GetEmailList(self):
  92. try:
  93. resp = requests.get(f"https://post-shift.ru/api.php?action=getlist&hash={self.postshift_api_hash}&key={self.mail['key']}")
  94. if resp.status_code != 200:
  95. raise Exception
  96. return resp.json()
  97. except Exception as e:
  98. print(f"Ошибка при Получении списка сообщений!!!\nЛог:{e}")
  99. return None
  100.  
  101. def GetEmailText(self):
  102. try:
  103. resp = requests.get(f"https://post-shift.ru/api.php?action=getmail&hash={self.postshift_api_hash}&key={self.mail['key']}&id=1")
  104. if resp.status_code != 200:
  105. raise Exception
  106. return resp.json()
  107. except Exception as e:
  108. print(f"Ошибка при Получении списка сообщений!!!\nЛог:{e}")
  109. return None
  110. def __init__(self,hash):
  111. self.postshift_api_hash=hash
  112. def ExtractPwd(message):
  113. match = re.search(r'href=[\'"]?([^\'" >]+)', message)
  114. if match:
  115. return match.group(0).replace('href="',"")
  116. else:
  117. return None
  118.  
  119. def GenPassword(min: int = 20, max: int = 20):
  120. pwd = ""
  121. special_list = ["!","@","#","$","%"]
  122. pwd += ''.join(random.choice(string.ascii_uppercase) for i in range(5))
  123. pwd += ''.join(random.choice(string.ascii_lowercase) for i in range(5))
  124. pwd += ''.join(random.choice(string.digits) for i in range(5))
  125. pwd += ''.join(random.choice(special_list) for i in range(5))
  126. return ''.join(random.sample(pwd,len(pwd)))
  127.  
  128. def main():
  129. itter_for_nigra = 1
  130. index = 0
  131. vt_list = [1, 3, 4, 5, 6, 8, 9]
  132. print(banner)
  133. # apihash = input("Ввдите api ключ от post shift: ")
  134. #apihash = '542524'
  135. # if len(apihash) != 32:
  136. # print("Неверный api hash!")
  137. # return 0
  138. while True:
  139. try:
  140. login = uuid.uuid4().hex.replace('-', '-')
  141. resp = requests.post(f"https://api.mail.tm/accounts", json={"address": login + "@sinaite.net",
  142. "password": "2@k6O8iJ"})
  143. if resp.status_code != 201:
  144. raise Exception
  145. email = resp.json()['address']
  146.  
  147. resp = requests.post(f"https://api.mail.tm/token", json={"address": email,
  148. "password": "2@k6O8iJ"})
  149. if resp.status_code != 200:
  150. raise Exception
  151. token = resp.json()['token']
  152.  
  153. resp = requests.get('https://api.mail.tm/messages', headers={'Authorization': 'Bearer ' + token})
  154. if resp.status_code != 200:
  155. raise Exception
  156.  
  157. a = Post_shift("")
  158. options = webdriver.ChromeOptions()
  159. options.add_extension('./ub.crx')
  160.  
  161. driver = webdriver.Chrome(ChromeDriverManager().install(), options=options)
  162. driver.implicitly_wait(5)
  163. driver.get("https://63.ru/text/education/2022/01/25/70386878/")
  164. try:
  165. driver.find_element_by_xpath('//*[@id="onesignal-slidedown-cancel-button"]').click()
  166. except:
  167. print()
  168.  
  169. driver.find_element_by_xpath('//*[@id="app"]/div[2]/header/div[1]/div[2]/a').click()
  170. driver.find_element_by_xpath('//*[@id="app"]/div[2]/div[3]/div/div/div[2]/div/form/div[3]/button').click()
  171. #a.Clear()
  172. # a.Regestration()
  173. #a.CreateMail()
  174. # driver.find_element_by_xpath('//*[@id="register_login"]').send_keys(a.mail['email'])
  175. driver.find_element_by_xpath('//*[@id="register_login"]').send_keys(email)
  176. driver.find_element_by_xpath('//*[@id="register_password"]').send_keys(GenPassword())
  177. driver.find_element_by_xpath('//*[@id="app"]/div[2]/div[4]/div/div/div[2]/div/form/button').click()
  178. print(f"Мыло: {email}")
  179. while True:
  180. time.sleep(1)
  181.  
  182. message = a.getEmailMessage(token)
  183. if message is not None:
  184. break
  185.  
  186. # respmails = a.GetEmailList()
  187. # if type(respmails) == list:
  188. # if respmails[0]["subject"] == "Регистрация на сайтах Сети городских порталов и Fontanka.ru":
  189. # break
  190. # else:
  191. # print("Ошибка письма!!!")
  192. # return 0
  193. print("Ожидаю письмо")
  194. driver.get(ExtractPwd(message))
  195. driver.get("https://63.ru/text/education/2022/01/25/70386878/")
  196. if itter_for_nigra % 5 == 0 and index < 7:
  197. print(f'Голосуем за кандидата номер: {vt_list[index]}!')
  198. driver.find_element_by_xpath(f'//*[@id="app"]/div[2]/div[1]/div/div/div[3]/div[2]/div[1]/div[1]/div[1]/div/div[2]/div[21]/div[2]/div[{vt_list[index]}]/div[2]/div[2]/div/button').click()
  199. index+=1
  200. else:
  201. index = 0
  202. print(f'Голосуем за нигру! Итерация {itter_for_nigra}')
  203. driver.find_element_by_xpath(f'//*[@id="app"]/div[2]/div[1]/div/div/div[3]/div[2]/div[1]/div[1]/div[1]/div/div[2]/div[21]/div[2]/div[{vt_list[index]}]/div[2]/div[2]/div/button').click()
  204. itter_for_nigra+=1
  205.  
  206. driver.close()
  207. except Exception as e:
  208. print("shhiiet: " + str(e))
  209. if driver is not None:
  210. try:
  211. driver.close()
  212. except:
  213. print("sssssshhhhhhhhieeet")
  214. finally:
  215. time.sleep(10)
  216.  
  217. if __name__ == '__main__':
  218.  
  219. main()
Add Comment
Please, Sign In to add comment