Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- import os
- import socket
- from IPClass import IP
- from colors import red, green, blue, yellow
- clear = lambda: os.system('cls')
- APIKEY = 'RREYzPuI3bphUbEC13iifxf839k91'
- RepetirMenu = True
- repetirIPChecker = True
- while RepetirMenu:
- clear()
- print(blue('[1] VPN/PROXY/TOR Checker'))
- print(blue('[2] Weather Checker'))
- print(red('[0] Salir'))
- print(' ')
- opcion = input(yellow('Seleccione una opción por favor: '))
- if int(opcion) == 1:
- while repetirIPChecker:
- esCorrecto = False
- while not esCorrecto:
- clear()
- ipaddress = input(yellow('Ingrese la dirección IP: '))
- ip = IP(ipaddress)
- if not ip.validate_ip(ipaddress):
- esCorrecto = True
- else:
- continue
- url = "https://www.ipqualityscore.com/api/json/ip/{}/{}".format(APIKEY,ipaddress)
- args = { "strictness":0, "allow_public_access_points":"true", "fast":"true", "lighter_penalties":"true" }
- response = requests.get(url, params=args)
- if response.status_code == 200:
- """
- file = open("response.html","wb")
- file.write(content)
- file.close()
- """
- response_json = json.loads(response.text)
- ISP = response_json['ISP']
- VPN = response_json['vpn']
- PROXY = response_json['proxy']
- TOR = response_json['tor']
- clear()
- print('ISP: ' + ISP)
- print(' ')
- print('VPN: ' + str(VPN))
- print('PROXY: ' + str(PROXY))
- print('TOR: ' + str(TOR))
- print(' ')
- print('[Y] = Intentar Denuevo')
- print('[N] = Salir al menu principal')
- print('[X] = Salir del programa')
- print(' ')
- opcionCorrecta = False
- while not opcionCorrecta:
- validator = input('Elija su opción: ')
- if validator == 'Y' or validator == 'y':
- break
- elif validator == 'N' or validator == 'n':
- repetirIPChecker = False
- break
- elif validator == 'X' or validator == 'x':
- exit()
- else:
- continue
- else:
- print("Tu url no sirve")
Add Comment
Please, Sign In to add comment