Advertisement
Guest User

ProxyCheck

a guest
Feb 22nd, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.68 KB | None | 0 0
  1.  
  2. import os
  3. import requests
  4. import time
  5. from time import sleep
  6. import datetime
  7.  
  8. ###########################
  9. today = datetime.datetime.today()
  10. t = today.strftime("%H:%M:%S")
  11. ###########################
  12.  
  13. class colors:
  14.     R = "\033[31;1m"
  15.     G = "\033[32;1m"
  16.     W = "\033[37;1m"
  17.     C = "\033[36;1m"
  18.     Y = "\033[0;33m"
  19.  
  20. def clear():
  21.     os.system("cls" if os.name == "nt" else "reset")
  22.  
  23.  
  24. def banner():
  25.     menu = """
  26. \033[0;31m============================================================
  27. \033[0;31m============================================================
  28. \033[0;32m
  29.    ____                           ________              __  
  30.   / __ \_________  _  ____  __   / ____/ /_  ___  _____/ /__
  31.  / /_/ / ___/ __ \| |/_/ / / /  / /   / __ \/ _ \/ ___/ //_/
  32. / ____/ /  / /_/ />  </ /_/ /  / /___/ / / /  __/ /__/ ,<  
  33. /_/   /_/   \____/_/|_|\__, /   \____/_/ /_/\___/\___/_/|_|  
  34.                      /____/                                
  35. \033[0;31m+============================================================
  36. \033[37;1m[\033[0;33m+\033[37;1m] Nome:\033[0;32m ProxyCheck
  37. \033[37;1m[\033[0;33m+\033[37;1m] Desenvolvedor:\033[0;32m Yusuke
  38. \033[37;1m[\033[0;33m+\033[37;1m] Versão:\033[0;32m 1.0
  39. \033[37;1m[\033[0;33m+\033[37;1m] Github:\033[0;32m https://github.com/yusukedev                
  40. \033[0;31m+============================================================
  41.     """
  42.     print(menu)
  43.  
  44. clear()
  45. banner()
  46. site = input("{}[{}?{}] Informe uma url: ".format(colors.W, colors.Y, colors.W))
  47. lista = input("{}[{}?{}] Informe lista de proxy: ".format(colors.W, colors.Y, colors.W))
  48. lista = open(lista, 'r').readlines()
  49. lista = [linha.replace('\n', '') for linha in lista]
  50. time = int(input("{}[{}?{}] Informe um tempo de resposta(ex:15): ".format(colors.W, colors.Y, colors.W)))
  51. if site == "":
  52.     site = "http://google.com"
  53. else:
  54.     site = site
  55.  
  56. print("")
  57. print("{}[{}*{}] Quantidade de proxy a ser checadas:{} {}".format(colors.W, colors.Y, colors.W, "\033[0;32m", len(lista)))
  58. print("{}[{}*{}] Iniciando checagem...".format(colors.W, colors.Y, colors.W))
  59. print("")
  60. sleep(0.5)
  61. g = 0
  62.  
  63. for linha in lista:
  64.     url = site
  65.     try:
  66.         req = requests.get(url, proxies={"http":"http://"+linha}, timeout=(time))
  67.         if req.status_code == 200:
  68.             print("  {}[{}{}{}] Working:{} {}".format(colors.W, colors.Y, t, colors.W, colors.G, linha))
  69.             g += 1
  70.             god = open('god.txt', 'a')
  71.             god.writelines('{} \n'.format(linha))
  72.         else:
  73.             print("  {}[{}{}{}] Bad Proxy:{} {}".format(colors.W, colors.Y, t, colors.W, colors.R, linha))
  74.     except:
  75.         print("  {}[{}{}{}] Bad Proxy:{} {}".format(colors.W, colors.Y, t, colors.W, colors.R, linha))
  76. print("")
  77. print("{}[{}+{}] Checagem finalizada.".format(colors.W, colors.Y, colors.W))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement