Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.68 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup as bs
  3. import json
  4. from utils import c_logging, n_logging
  5. from random import *
  6. import random
  7. import re
  8. import string
  9. import time
  10. import sys
  11. from threading import Thread
  12. from queue import Queue
  13.  
  14. with open('config.json') as file:
  15. config = json.load(file)
  16. file.close()
  17.  
  18. if config['useproxies'] == "True":
  19. useproxies = "True"
  20. else:
  21. useproxies = "False"
  22.  
  23. def file_len(fname):
  24. with open(fname) as f:
  25. for i, l in enumerate(f):
  26. pass
  27. return i + 1
  28.  
  29. class Worker(Thread):
  30. def __init__(self, queue, x):
  31. Thread.__init__(self)
  32. self.queue = queue
  33. def run(self):
  34. global taskcount
  35. waitTime = config['waitTime']
  36. time.sleep(float(waitTime))
  37. captchaurl = "https://kithnyc.typeform.com/to/ySnFiu?typeform-embed=popup-blank"
  38. url = "https://kithnyc.typeform.com/to/ySnFiu"
  39. s = requests.session()
  40. headers = {
  41. 'Accept': 'application/json, text/javascript, */*; q=0.01',
  42. 'Accept-Encoding': 'gzip, deflate, br',
  43. 'Accept-Language': 'en-US,en;q=0.9',
  44. 'Connection': 'keep-alive',
  45. 'Content-Type': 'application/x-www-form-urlencoded',
  46. 'Host': 'kithnyc.typeform.com',
  47. 'Origin': 'https://kithnyc.typeform.com',
  48. 'Referer': 'https://kithnyc.typeform.com/to/ySnFiu?typeform-embed=popup-blank',
  49. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36',
  50. 'X-Requested-With': 'XMLHttpRequest'
  51. }
  52. successcount = 0
  53. print("")
  54.  
  55. while True:
  56. time.sleep(float(waitTime))
  57. self.queue.get()
  58.  
  59. print("")
  60. if useproxies == "True":
  61. def random_line(fname):
  62. lines = open(fname).read().splitlines()
  63. return random.choice(lines)
  64. proxy = random_line('proxies.txt')
  65. c_logging("Using Proxy {}".format(proxy), "yellow")
  66.  
  67. try:
  68. proxytest = proxy.split(":")[2]
  69. userpass = True
  70. except IndexError:
  71. userpass = False
  72.  
  73.  
  74. if userpass == True:
  75. ip = proxy.split(":")[0]
  76. port = proxy.split(":")[1]
  77. userpassproxy = ip + ':' + port
  78. proxyuser = proxy.split(":")[2].rstrip()
  79. proxypass = proxy.split(":")[3].rstrip()
  80.  
  81. if userpass == True:
  82. proxies = {'http': 'http://' + proxyuser + ':' + proxypass + '@' + userpassproxy, 'https': 'http://' + proxyuser + ':' + proxypass + '@' + userpassproxy}
  83. if userpass == False:
  84. proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy}
  85.  
  86.  
  87.  
  88. firstname = config['FirstName']
  89. lastname = config['LastName']
  90. location = config['Location']
  91. email = config['Email']
  92. if config['multiperson'] == "True":
  93. namfelist = ['0', "1", "2", "3"]
  94. namslist = randint(0, len(namfelist) - 1)
  95. optionforname = namfelist[namslist]
  96.  
  97. if optionforname == "1":
  98. firstname = config['Person2'].split(" ")[0]
  99. lastname = config['Person2'].split(" ")[1]
  100. if optionforname == "2":
  101. firstname = config['Person3'].split(" ")[0]
  102. lastname = config['Person3'].split(" ")[1]
  103. if optionforname == "3":
  104. firstname = config['Person4'].split(" ")[0]
  105. lastname = config['Person4'].split(" ")[1]
  106. if optionforname == "0":
  107. firstname = config['FirstName']
  108. lastname = config['LastName']
  109. mname = random.choice(string.ascii_letters)
  110. suffixtitlel = ['jr', 'jr.', 'JR.', 'JR.', 'SR', 'sr.', 'sr', 'sr.',
  111. 'snr', 'SNR', 'SNR.', 'jnr', 'JNR', 'JNR.', 'II',
  112. 'III', '2nd', '3rd']
  113. suffixtitlenum = randint(0, len(suffixtitlel) - 1)
  114. suffix = suffixtitlel[suffixtitlenum]
  115. typelist = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '15', '16', '17', '18', '19', '20']
  116. typenum = randint(0, len(typelist) - 1)
  117. typee = typelist[typenum]
  118. if typee == "1":
  119. firstname = "Mr. " + firstname
  120. if typee == "2":
  121. firstname = "Mr. " + firstname
  122. lastname = lastname + " " + suffix
  123. if typee == "3":
  124. firstname = "Mr. " + firstname + " " + suffix
  125. if typee == "4":
  126. firstname = "Mr " + firstname
  127. if typee == "5":
  128. firstname = "Mr " + firstname
  129. lastname = lastname + " " + suffix
  130. if typee == "6":
  131. firstname = "Mr " + firstname + " " + suffix
  132. if typee == "7":
  133. firstname = "Mister " + firstname
  134. if typee == "8":
  135. firstname = "Mister " + firstname
  136. lastname = lastname + " " + suffix
  137. if typee == "9":
  138. firstname = "Mister " + firstname + " " + suffix
  139. if typee == "10":
  140. lastname = lastname + " " + suffix
  141. if typee == "11":
  142. firstname = firstname + " " + suffix
  143. if typee == "12":
  144. if config['middlenamejig'] == "True":
  145.  
  146. firstname = firstname + " " + mname
  147. else:
  148. firstname = "Mister " + firstname + " " + suffix
  149. if typee == "13":
  150. if config['middlenamejig'] == "True":
  151. firstname = "Mr " + firstname + " " + mname
  152. else:
  153. firstname = "Mr " + firstname
  154. if typee == "14":
  155. if config['middlenamejig'] == "True":
  156. firstname = "Mister " + firstname + " " + mname
  157. else:
  158. firstname = "Mr. " + firstname
  159. if typee == "15":
  160. if config['middlenamejig'] == "True":
  161. firstname = firstname + " " + mname
  162. lastname = lastname + " " + suffix
  163. else:
  164. lastname = lastname + " " + suffix
  165. if typee == "16":
  166. firstname = "Mister. " + firstname
  167. if typee == "17":
  168. firstname = "Mister. " + firstname
  169. lastname = lastname + " " + suffix
  170. if typee == "18":
  171. firstname = "Mister. " + firstname + " " + suffix
  172. if typee == "19":
  173. if config['middlenamejig'] == "True":
  174. firstname = "Mister. " + firstname + " " + mname
  175. else:
  176. firstname = "Mister. " + firstname
  177. if typee == "20":
  178. if config['middlenamejig'] == "True":
  179. firstname = "Mister. " + firstname + " " + mname
  180. lastname = lastname + " " + suffix
  181. else:
  182. firstname = "Mister. " + firstname
  183. lastname = lastname + " " + suffix
  184.  
  185.  
  186.  
  187.  
  188.  
  189. if config['emailjig'] == "gmail":
  190. prefix = email.split('@')[0]
  191. number = randint(111, 9999999)
  192. if number > 9999999:
  193. number = randint(111, 9999999)
  194. email = "{}+{}@gmail.com".format(prefix, number)
  195. else:
  196. prefix = email.split('@')[0]
  197. domain = email.split('@')[1]
  198. number = randint(111, 9999999)
  199. if number > 9999999:
  200. number = randint(111, 9999999)
  201. email = "{}{}@{}".format(prefix, number, domain)
  202.  
  203. if config['sizegender'] == "male":
  204. sizelist = ['7', '8', '9', '10', '11']
  205. else:
  206. sizelist = ['6', '7', '8', '9', '10', '11']
  207. sizenum = randint(0, len(sizelist) - 1)
  208. asize = sizelist[sizenum]
  209. if config['sizegender'] == "male":
  210. size = "Men's " + asize
  211. else:
  212. size = "Woman's " + asize
  213.  
  214. if location == "soho":
  215. kithlocation = "Kith Soho"
  216. else:
  217. kithlocation = "Kith Brooklyn"
  218.  
  219. d = requests.get("https://kithnyc.typeform.com/to/ySnFiu?typeform-embed=popup-blank")
  220. soup = bs(d.content, "html.parser")
  221. bigreturn = soup.find_all("script")
  222. jscap = str(bigreturn[21])
  223. capnohtml = re.sub("<.*?>", "", jscap)
  224. capfilter1 = capnohtml[26:]
  225. capfilter2 = capfilter1.split('"value":"')[1]
  226. captchavalue = capfilter2.split('"')[0]
  227.  
  228.  
  229. payload = {
  230. 'form[language]': 'en',
  231. 'form[textfield:OSwjNf51Vlq5]': firstname,
  232. 'form[textfield:WS8KFzUfJKZ6]': lastname,
  233. 'form[email:mSTAlyznz1A1]': email,
  234. 'form[list:Z89n81xJhqQK][choices]': kithlocation,
  235. 'form[list:Z89n81xJhqQK][other]': '',
  236. 'form[list:kXPnX9LjujQw][choices]': size,
  237. 'form[list:kXPnX9LjujQw][other]': '',
  238. 'form[textfield:p6P2thoLnUI4]': captchavalue,
  239. 'form[landed_at]': int(time.time()),
  240. 'form[token]': '641e8d6d42680852d04e1623235b7295$2y$11$e2dJZC0zIXZQK1pxbSZbL.iWNMlMlNL.HW4Y/MIZPaow0szjB6mUm'
  241. }
  242.  
  243. if useproxies == "True":
  244. j = s.post(url, headers=headers, data=payload, proxies=proxies)
  245. #c_logging("Sending Request", "yellow")
  246. else:
  247. j = s.post(url, headers=headers, data=payload)
  248. #c_logging("Sending Request", "yellow")
  249. taskcount = taskcount + 1
  250. taskcounts = "{}{}{}".format(int(taskcount), "/", int(num))
  251. n_logging("++++++++++++++++++++++++++++++++++")
  252. c_logging("TASK # {}".format(taskcounts), "cyan")
  253. c_logging("Name Set to " + firstname + " " + lastname, "yellow")
  254. c_logging("Created email {}".format(email), "yellow")
  255. c_logging("Choose size " + size, "yellow")
  256. c_logging("Obtained Captcha Answer ({})".format(captchavalue), "yellow")
  257.  
  258. if "success" in j.text:
  259. c_logging("Entered into raffle", "green")
  260. n_logging("++++++++++++++++++++++++++++++++++")
  261. successcount = successcount + 1
  262. else:
  263. c_logging("FAILED TO ENTER ACCOUNT", "red")
  264. n_logging("++++++++++++++++++++++++++++++++++")
  265. self.queue.task_done()
  266. if successcount < 1:
  267. c_logging("NO ENTRIES MADE", "red")
  268. else:
  269. n_logging("-----------------------------")
  270. c_logging("Successfully Entered " + str(successcount) + "/" + str(num), "green")
  271. c_logging("If you like this consider helping me https://www.paypal.me/ehxoh XO", "green")
  272.  
  273.  
  274. def multithread(num, tasks):
  275. global taskcount
  276. taskcount = int(0)
  277. count = int(num)
  278. queue = Queue()
  279. for i in range(int(tasks)):
  280. print('making worker')
  281. worker = Worker(queue, i)
  282. worker.daemon = True
  283. worker.start()
  284. for i in range(int(count)):
  285. queue.put(10);
  286. queue.join()
  287.  
  288. if __name__ == '__main__':
  289. print("")
  290. n_logging("##########################################")
  291. c_logging("Kith Futurecraft Script v8", "cyan")
  292. c_logging("By XO", "cyan")
  293. c_logging("Thanks Ry and Kyel and Sole Dev", "cyan")
  294. c_logging("Wanna buy me a big mac? https://www.paypal.me/ehxoh", "cyan")
  295. c_logging("PLEASE DO NOT DM FOR HELP JUST SEND SOMETHING IN GENERAL", "red")
  296. n_logging("###########################################")
  297. print("")
  298. print("")
  299. n_logging("===========================================")
  300. c_logging("Name: " + config['FirstName'] + " " + config['LastName'], "magenta")
  301. c_logging("Email: " + config['Email'], "magenta")
  302. c_logging("Size Gender: " + config['sizegender'], "magenta")
  303. c_logging("Location: " + config['Location'], "magenta")
  304. c_logging("Using Proxies?: " + config['useproxies'], "magenta")
  305. c_logging("Middle Name Jig?: {}".format(config['middlenamejig']), "magenta")
  306. c_logging("Email Jig Being Used?: {}".format(config['emailjig']), "magenta")
  307. c_logging("Using A Wait Time Of {} seconds".format(config['waitTime']), "magenta")
  308. n_logging("==========================================")
  309. print("")
  310. print("")
  311. num = input("# Of Entries? ")
  312. tasks = input("Number of threads?: ")
  313.  
  314. yesno = input("START BOT (y/n): ")
  315. if yesno == "y":
  316. multithread(num, tasks)
  317. else:
  318. sys.exit("You choose no to start please press y when prompted")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement