-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIIO.py
58 lines (49 loc) · 2.06 KB
/
IIO.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from time import sleep
import requests
from urllib.parse import urlparse
import urllib3
import os
print(" ___________________________________________________ ")
print("| Welcome to IsItOnline program aka IIO |")
print("|___________________________________________________|")
sleep(1.5)
print(" ___________________________________ ")
print(" | Made By Thexgamelord_ |")
print(" |___________________________________|")
print(" _____________________________________ ")
print(" | github.com/Thexgamelord |")
print(" |_____________________________________|")
while True:
myreq= input("enter destination to check: ")
if myreq != "http://"+myreq:
myreq = myreq.replace("http://","")
myreq = myreq.replace("https://","")
myreq = myreq.replace("/","")
finalreq = "http://"+myreq+"/"
#print(finalreq)
try:
domain = "???"
rqchk = requests.get(finalreq, timeout=3)
domain = urlparse(finalreq).netloc
if rqchk.status_code == 200:
print(f"[INFO] {domain} is online!")
else:
print(f"[INFO] {domain} is not online or doesnt respond to requests.")
except requests.exceptions.InvalidURL:
print("[ERROR] Please make sure to input a valid ip or url")
except ConnectionRefusedError:
print(f"[ERROR] Connection Refused by {domain}")
except urllib3.exceptions.NewConnectionError:
print("[ERROR] New connection error")
except urllib3.exceptions.MaxRetryError:
print("[ERROR] Max retry error")
except requests.exceptions.ConnectionError:
print("[ERROR] Connection error")
except requests.exceptions.ReadTimeout:
print("[ERROR] ReadTimeout {0}".format(domain))
sleep(1)
# domain = urlparse(finalreq).netloc
# if rqchk.status_code == 200:
# print(f"[INFO] {domain} is online!")
# else:
# print(f"[INFO] {domain} is not online or doesnt respond to requests.")