Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. from selenium import webdriver
  2. from selenium.webdriver.common.keys import Keys
  3. import time
  4. from requests import post
  5. import requests
  6. import json
  7. from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask
  8. import re
  9.  
  10.  
  11.  
  12. def stamina(s):
  13.  
  14. stamina = s.get("https://kaizoku.atomiplay.com/vantagens-vip")
  15. resposta = stamina.text
  16.  
  17. total = resposta.split('class="barra-exp yellow"',2)
  18. total = total[1].split('px;"><span>',2)
  19. total = total[1].split('/ 30</span></div></div>',2)
  20.  
  21. total = total[0]
  22. print("Stamina: ",total)
  23.  
  24. def VerCaptcha(s):
  25.  
  26. cap = s.get("https://kaizoku.atomiplay.com/vantagens-vip")
  27. resposta = cap.text
  28.  
  29. if("data-sitekey=" in resposta):
  30. print("Ta em Captcha")
  31. return 1
  32. else:
  33. return 0
  34.  
  35. def ResolverCaptcha(s):
  36.  
  37. api_key = 'd66c652fb9c92b80ca050254f38666c8'
  38. site_key = '6LcPIAkTAAAAAA_aK_Q8OZHCU9mDvBUbNFp0PLbl'
  39. url = 'https://kaizoku.atomiplay.com/'
  40.  
  41. client = AnticaptchaClient(api_key)
  42. task = NoCaptchaTaskProxylessTask(url, site_key)
  43. job = client.createTask(task)
  44. job.join()
  45. resposta = job.get_solution_response()
  46.  
  47. infos = {
  48. "g-recaptcha-response":resposta,
  49. "btnCaptcha":"Enviar"
  50. }
  51.  
  52. resolver = s.post("https://kaizoku.atomiplay.com/vantagens-vip",data=infos)
  53.  
  54. print("Resolvido!!")
  55.  
  56.  
  57.  
  58.  
  59. def xp(s):
  60.  
  61. xp = s.get("https://kaizoku.atomiplay.com/vantagens-vip")
  62. resposta = xp.text
  63.  
  64. total = resposta.split('<div class="progress-bar" id="tip-w" original-title="<b>EXPERIENCIA:</b> ',2)
  65. total = total[1].split('"><div class="barra-exp purple"',2)
  66. #total = total[1].split('/ 30</span></div></div>',2)
  67.  
  68. total = total[0]
  69. print("Xp: ",total)
  70.  
  71.  
  72. def teste():
  73.  
  74. login = {
  75. "user":"rafaelconcept@hotmail.com",
  76. "senha":"99875722rafa"
  77. }
  78.  
  79.  
  80. with requests.Session() as s:
  81. p = s.post('https://kaizoku.atomiplay.com/json/home/?action=login', data=login)
  82.  
  83.  
  84. requests2 = s.post("https://kaizoku.atomiplay.com/json/home/?action=logInCharacter",{"id":"97048"})
  85.  
  86.  
  87. b = 0
  88.  
  89. while 1==1:
  90.  
  91.  
  92. atacando = s.post("https://kaizoku.atomiplay.com/json/island/?action=challenge",{"id_npc":"430"})
  93.  
  94. a = 0
  95. while a<4:
  96. batendo = s.get('https://kaizoku.atomiplay.com/json/npc/?action=attack&id=457&_=1570985315049')
  97.  
  98. if(batendo.text == "<script>self.location='personagens'</script>"):
  99. ## print("Deslogado, tente novamente")
  100. break
  101.  
  102. a = a +1
  103.  
  104. if(batendo.text == "<script>self.location='personagens'</script>"):
  105. print("Deslogado, tente novamente")
  106. break
  107.  
  108.  
  109.  
  110.  
  111. cap = VerCaptcha(s)
  112. if(cap==1):
  113. print("Resolver Captcha")
  114. ResolverCaptcha(s)
  115. else:
  116. stamina(s)
  117. xp(s)
  118. curar = s.get('https://kaizoku.atomiplay.com/hospital?acao=completo')
  119.  
  120. b = b + 1
  121. print("Loop: ",b)
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138. def testarCap():
  139. if(driver.find_elements_by_css_selector('.wrap-captcha')):
  140. captcha()
  141.  
  142. time.sleep(4)
  143. driver.get("https://kaizoku.atomiplay.com/mercado")
  144. time.sleep(3)
  145.  
  146. else:
  147. return 1
  148.  
  149.  
  150. teste()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement