Python automation script [Release][Bot][Free] BitVisitor Bot v0.9 beta - Earn Bitcoin$!!


SUBMITTED BY: alemotta

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

FORMAT: Text only

SIZE: 7.4 kB

HITS: 147

  1. Python automation script [Release][Bot][Free] BitVisitor Bot v0.9 beta - Earn Bitcoin$!!
  2. '''
  3. This script allows you to use bitvisitor.com without having to open it in a webbrowser.
  4. However, you will still have to wait the 5 minutes and enter the captchas manually.
  5. It is mainly a console application, but a small window will ask you for the captchas.
  6. This script was tested with Python 2.7 on Windows 7. Besides the standard stuff,
  7. it depends on BeautifulSoup (http://www.crummy.com/software/BeautifulSoup/)
  8. and PIL (http://www.pythonware.com/products/pil/).
  9. usage: pyvisitor.py [-h] [-u path] [-a address]
  10. optional arguments:
  11. -h, --help Show this help message and exit.
  12. -u path, --user-agents path A path to a file containing a user-agent on each line.
  13. -a address, --address address Your bitcoin address. If omitted, you will be prompted.
  14. Created on 02.01.2013
  15. Last update on 29.03.2013
  16. @author: The_Exile
  17. Feel free to drop me a coin or two at 13QgXZGtXYEY9cnEB9mGuD1ZbXMWirTicg
  18. '''
  19. from PIL import Image, ImageTk
  20. from Tkinter import Tk, Entry, Label
  21. from argparse import ArgumentParser
  22. from bs4 import BeautifulSoup
  23. from cStringIO import StringIO
  24. from cookielib import CookieJar
  25. from random import randrange, choice
  26. from time import sleep
  27. from urllib import urlencode
  28. from urllib2 import urlopen, Request, HTTPCookieProcessor, install_opener, build_opener, URLError
  29. class InputWindow:
  30. def __init__(self, captcha, img=None, p=None):
  31. root = Tk()
  32. root.attributes('-topmost', 1)
  33. hint = '(Enter - submit, Esc - abort)'
  34. if img is None:
  35. root.wm_title('Address')
  36. hint = 'Please enter your Bitcoin address.\n' + hint
  37. else:
  38. root.wm_title('Captcha {0:.4f}'.format(p))
  39. img = ImageTk.PhotoImage(img)
  40. root.img_reference = img
  41. image = Label(root, image=img, text=hint, compound='top')
  42. image.pack()
  43. entry = Entry(root)
  44. entry.bind('<Escape>', lambda _:root.destroy())
  45. entry.bind('<Return>', lambda _:(captcha.set(entry.get()), root.destroy()))
  46. entry.pack()
  47. entry.focus_set()
  48. root.update_idletasks()
  49. xp = (root.winfo_screenwidth() / 2) - (root.winfo_width() / 2) - 8
  50. yp = (root.winfo_screenheight() / 2) - (root.winfo_height() / 2) - 20
  51. root.geometry('+%d+%d' % (xp, yp))
  52. root.mainloop()
  53. class Captcha:
  54. def __init__(self): self.value = None
  55. def set(self, value): self.value = value
  56. class PyVisitor:
  57. def __init__(self, address=None, agentFile=None):
  58. self.__addr = address
  59. if not address:
  60. address = Captcha()
  61. InputWindow(address)
  62. if not address.value:
  63. print 'Aborted by user.'
  64. exit(0)
  65. self.__addr = address.value
  66. self.__profit = self.__currentProfit = .0
  67. self.__currency = ''
  68. self.__captchaURL = None
  69. self.__host = 'http://bitvisitor.com/'
  70. defaultAgent = 'Opera/9.80 (Windows NT 5.1; U; en) Presto/2.10.289 Version/12.01'
  71. self.__headers = {'Accept':'text/html,application/xhtml+xml,application/xml',
  72. 'User-Agent':defaultAgent}
  73. install_opener(build_opener(HTTPCookieProcessor(CookieJar())))
  74. if agentFile:
  75. try:
  76. with open(agentFile) as f:
  77. self.__headers['User-Agent'] = choice([agent.rstrip() for agent in f])
  78. except:
  79. print 'Using default User-Agent.'
  80. print 'User-Agent:', self.__headers['User-Agent']
  81. def __getCaptchaURL(self, soup):
  82. captchaImg = soup.find('img', id='siimage')
  83. if not captchaImg:
  84. return
  85. earning = soup.find('h1', 'page-header').contents[1].split()
  86. self.__currentProfit = float(earning[0])
  87. if not self.__currency: self.__currency = earning[1]
  88. self.__captchaURL = self.__host + captchaImg['src'].lstrip('./')
  89. return self.__captchaURL
  90. def __wait(self, soup):
  91. siteFrame = soup.find('iframe', id='mlsFrame')
  92. if not siteFrame: return
  93. print 'Visiting', siteFrame['src']
  94. print 'Getting {0:.4f} {1} in'.format(self.__currentProfit,self.__currency),
  95. for i in range(5, 0, -1):
  96. print i,
  97. sleep(60)
  98. print
  99. sleep(randrange(1, 10)) # just to be sure ;)
  100. def visit(self):
  101. req = Request(self.__host, None, self.__headers)
  102. res = urlopen(req) # set session cookie
  103. if 'abuse' in res.geturl():
  104. print 'ERROR: The IP address was deemed suspicious.'
  105. return
  106. # Please do not change the address in the next line. It costs you nothing, but it helps me.
  107. params = urlencode({'addr':self.__addr, 'ref':'1Mj8JCYJDjDKMjmvsTrpVPap4BvFyGZVCm'})
  108. url = self.__host + 'next.php'
  109. self.__headers['Referer'] = url
  110. req = Request(url, params, self.__headers)
  111. while True:
  112. res = urlopen(req)
  113. if 'abuse' in res.geturl():
  114. print 'ERROR: The IP address was deemed suspicious.'
  115. break
  116. soup = BeautifulSoup(res.read())
  117. if not self.__getCaptchaURL(soup): break
  118. a = None
  119. while not a:
  120. captcha = Captcha()
  121. InputWindow(captcha, Image.open(StringIO(urlopen(self.__captchaURL).read())), self.__currentProfit)
  122. if not captcha.value:
  123. print 'Aborted by user.'
  124. break
  125. cParams = urlencode({'ct_captcha':captcha.value, 'addr':self.__addr})
  126. soup = BeautifulSoup(urlopen(Request(url, cParams, self.__headers)).read())
  127. form = soup.find('form', action='next.php')
  128. if not form:
  129. message = soup.get_text()
  130. if 'Incorrect' in message: continue
  131. print message
  132. break
  133. a = form.find('input', {'name':'a'})['value']
  134. if a: break
  135. if not a: # aborted by user or site error
  136. break
  137. self.__wait(soup)
  138. nParams = urlencode({'addr':self.__addr, 'a':a})
  139. res = urlopen(Request(url, nParams, self.__headers))
  140. if not res:
  141. break
  142. self.__profit += self.__currentProfit
  143. print 'Earned {0:.4f} {1} ({2:.4f} {1})'.format(self.__currentProfit, self.__currency, self.__profit)
  144. print 'Exiting with {0} {1} earned.'.format(self.__profit, self.__currency)
  145. def main():
  146. parser = ArgumentParser()
  147. parser.add_argument('-u', '--user-agents', metavar='path',
  148. help='A path to a file containing a user-agent on each line.')
  149. parser.add_argument('-a', '--address', metavar='address',
  150. help='Your bitcoin address. If omitted, you will be prompted.')
  151. ns = parser.parse_args()
  152. try:
  153. PyVisitor(ns.address, ns.user_agents).visit()
  154. except URLError as e:
  155. print str(e)
  156. if __name__ == "__main__":
  157. main()

comments powered by Disqus