Advertisement
dopeFox

[Python 2.7.3] TheFox's xat ID Generator

Nov 8th, 2014
760
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.78 KB | None | 0 0
  1. import urllib, urllib2
  2. import random
  3. #Create a new txt file called 'proxies.txt' in the same folder that this script is in, and add proxies to it. ONLY HTTPS proxies will work!
  4. #Script coded by: TheFox
  5. print("~~~~~~~~~~~~~~~~~~~~~~~~~~")
  6. print("TheFox's xat ID generator")
  7. print("~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n")
  8. print("*Note: if you want to use default proxies (which is INSANELY slow, then do not create a 'proxies.txt' in the same folder as this script. If you want to use your OWN proxies (WAY FASTER), the create a new .txt file called 'proxies.txt' in the same folder that this script is in, and add https proxies into it.\n\n")
  9. raw_input("-> Press 'Enter' to start <-")
  10. def getBetween(strSource, strStart,strEnd):
  11.     start = strSource.find(strStart) + len(strStart)
  12.     end = strSource.find(strEnd,start)
  13.     return strSource[start:end]
  14. def id_Generator():
  15.     while 1:
  16.          try:
  17.              Proxies_Exist = True
  18.              Proxies = [i.strip() for i in open('proxies.txt','r').read().splitlines()]
  19.              Proxies = random.choice(Proxies)
  20.              Proxy = Proxies.split(':')
  21.              ProxyInfo = 'http://' + str(Proxy[0]) + ':' + str(Proxy[1])
  22.              print("---------------------------------")
  23.              print("~[ Successfully loaded proxy ]~")
  24.              print("---------------------------------\n")
  25.              print("Proxy being used: " + str(Proxy[0]) + ':' + str(Proxy[1]) + "\n")
  26.              Auser3 = urllib.urlopen('http://xat.com/web_gear/chat/auser3.php', proxies = { 'http': ProxyInfo }).read()
  27.              Ids = open("ids.txt","a+")
  28.              if Auser3 in Ids != False or Auser3.find('&UserId=') != False:#Duplicate ID and 404 Error fix
  29.                  Ids.write("")
  30.                  Ids.close()
  31.                  id_Generator()
  32.              else:
  33.                  Ids.write(Auser3 + "\n")
  34.                  Ids.close()
  35.                  print("New ID Found: " + Auser3 + "\n")
  36.                  id_Generator()
  37.          except:
  38.              Proxies_Exist = False
  39.              if Proxies_Exist == False:
  40.                  print("'proxies.txt' was not found! Using default proxies from: http://www.us-proxy.org/\n")
  41.                  try:
  42.                      US_PROXY = urllib.urlopen('http://www.us-proxy.org/').read()
  43.                      IP = getBetween(US_PROXY,'<tbody><tr><td>','</td>').splitlines()
  44.                      Port = getBetween(US_PROXY,'</td><td>','</td><td>US</td><td>').splitlines()
  45.                      IP = random.choice(IP)
  46.                      Port = random.choice(Port)
  47.                      ProxyInfo = 'http://' + str(IP) + ':' + str(Port)
  48.                      print("--------------------------------------------------------------------------")
  49.                      print("~[ Successfully loaded proxy from http://www.us-proxy.org/ ]~")
  50.                      print("--------------------------------------------------------------------------")
  51.                      print("Proxy being used: " + str(IP) + ':' + str(Port) + "\n")
  52.                      Auser3 = urllib.urlopen('http://xat.com/web_gear/chat/auser3.php', proxies = { 'http': ProxyInfo }).read()
  53.                      Ids = open("ids.txt","a+")
  54.                      if Auser3 in Ids != False or Auser3.find('&UserId=') != False:#Duplicate ID and 404 Error fix
  55.                          Ids.write("")
  56.                          Ids.close()
  57.                          id_Generator()
  58.                      else:
  59.                          Ids.write(Auser3 + "\n")
  60.                          Ids.close()
  61.                          print("New ID Found: " + Auser3 + "\n")
  62.                          id_Generator()
  63.                  except:
  64.                     print("Could not connect to 'http://www.us-proxy.org/' ! Restarting script!'")
  65.                     id_Generator()
  66. id_Generator()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement