Python bot for freebicoin.in


SUBMITTED BY: alemotta

DATE: Feb. 28, 2017, 10:32 p.m.

FORMAT: Text only

SIZE: 4.5 kB

HITS: 515

  1. Python bot for freebicoin.in
  2. # -*- coding: utf-8 -*-
  3. from selenium import webdriver
  4. from selenium.webdriver.common.by import By
  5. from selenium.webdriver.common.keys import Keys
  6. from selenium.webdriver.support.ui import Select
  7. from selenium.common.exceptions import NoSuchElementException
  8. from selenium.common.exceptions import NoAlertPresentException
  9. import unittest, time, re
  10. import os
  11. from PIL import Image
  12. from tesserocr import PyTessBaseAPI
  13. driver = webdriver.Chrome()
  14. driver.maximize_window()
  15. driver.get('https://freebitco.in/')
  16. driver.find_element_by_xpath("html/body/div[1]/div/nav/section/ul/li[10]/a").click()
  17. Select(driver.find_element_by_id("signup_page_captcha_types")).select_by_visible_text("Solve Media")
  18. time.sleep(2)
  19. scheight = .1
  20. while scheight < 9.9:
  21. driver.execute_script("window.scrollTo(0, document.body.scrollHeight/%s);" % scheight)
  22. scheight += .01
  23. def execute():
  24. driver.execute_script("javascript:ACPuzzle.reload('')")
  25. time.sleep(9)
  26. driver.save_screenshot('driver.png')
  27. image_file = Image.open("driver.png") # open colour image
  28. image_file= image_file.convert('L') # convert image to monochrome - this works
  29. image_file.save('result.png')
  30. images = ['result.png' ]
  31. with PyTessBaseAPI() as api:
  32. for img in images:
  33. api.SetImageFile(img)
  34. pignore = (api.GetUTF8Text())
  35. ignore= (api.AllWordConfidences())
  36. pignore = str(pignore)
  37. matchObj = re.search( r'Please Enter (.*)', pignore, re.M|re.I)
  38. if matchObj:
  39. game = matchObj.group(1)
  40. driver.execute_script("document.getElementById('login_form_btc_address').value+='example@email.com'")
  41. driver.find_element_by_id("login_form_password").send_keys("password")
  42. driver.find_element_by_id("adcopy_response").send_keys(game)
  43. driver.find_element_by_id("login_button").click()
  44. time.sleep (5)
  45. else:
  46. execute()
  47. execute()
  48. def brutal():
  49. driver.get('https://freebitco.in/?op=home')
  50. Select(driver.find_element_by_id("free_play_captcha_types")).select_by_visible_text("Solve Media")
  51. time.sleep(10)
  52. scheight = .1
  53. while scheight < 2:
  54. driver.execute_script("window.scrollTo(0, document.body.scrollHeight/%s);" % scheight)
  55. scheight += .01
  56. brutal()
  57. def execute2():
  58. driver.save_screenshot('driver.png')
  59. image_file = Image.open("driver.png") # open colour image
  60. image_file= image_file.convert('L') # convert image to monochrome - this works
  61. #image_file= image_file.convert('1') # convert image to black and white
  62. image_file.save('result.png')
  63. images = ['result.png' ]
  64. with PyTessBaseAPI() as api:
  65. for img in images:
  66. api.SetImageFile(img)
  67. pignore = (api.GetUTF8Text())
  68. ignore= (api.AllWordConfidences())
  69. pignore = str(pignore)
  70. matchObj1 = re.search( r'Please Enter. (.*)', pignore, re.M|re.I)
  71. if matchObj1:
  72. game = matchObj1.group(1)
  73. driver.find_element_by_id("adcopy_response").send_keys(game)
  74. frame1 = driver.find_element_by_id("free_play_form_button")
  75. driver.execute_script("$(arguments[0]).click();", frame1)
  76. print ("Waiting 60 minutes for next claim")
  77. time.sleep(3600)
  78. brutal()
  79. else:
  80. matchObj2 = re.search( r'Please Enter, (.*)', pignore, re.M|re.I)
  81. if matchObj2:
  82. game2 = matchObj2.group(1)
  83. driver.find_element_by_id("adcopy_response").send_keys(game2)
  84. frame2 = driver.find_element_by_id("free_play_form_button")
  85. driver.execute_script("$(arguments[0]).click();", frame2)
  86. ("Waiting 60 minutes for next claim")
  87. time.sleep(3600)
  88. brutal()
  89. else:
  90. matchObj3 = re.search( r'Ple ase Enter, (.*)', pignore, re.M|re.I)
  91. if matchObj3:
  92. game3 = matchObj3.group(1)
  93. driver.find_element_by_id("adcopy_response").send_keys(game3)
  94. frame3 = driver.find_element_by_id("free_play_form_button")
  95. driver.execute_script("$(arguments[0]).click();", frame3)
  96. ("Waiting 60 minutes for next claim")
  97. time.sleep(3600)
  98. brutal()
  99. else:
  100. driver.execute_script("javascript:ACPuzzle.reload('')")
  101. time.sleep(10)
  102. execute2()
  103. execute2()

comments powered by Disqus