-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
65 lines (50 loc) · 2.87 KB
/
main.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
59
60
61
62
63
64
65
import requests
import sys
print("\033[32m" + """
,----,
,----.. ,/ .`| ,--. ,-.----.
/ / \ .--.--. ,` .' : ,---, ,--.'| ,---,\ / \
/ . : / / '. ; ; /,`--.' | ,--,: : | ,`--.' || : \
. / ;. \ : /`. /.'___,/ ,' | : :,`--.'`| ' : | : :| | .\ :
. ; / ` ; | |--` | : | : | '| : : | | : | '. : |: |
; | ; \ ; | : ;_ ; |.'; ; | : |: | \ | : | : || | \ :
| : | ; | '\ \ `.`----' | | ' ' ;| : ' '; | ' ' ;| : . /
. | ' ' ' : `----. \ ' : ; | | |' ' ;. ; | | |; | |`-'
' ; \; / | __ \ \ | | | ' ' : ;| | | \ | ' : ;| | ;
\ \ ', / / /`--' / ' : | | | '' : | ; .' | | ': ' |
; : / '--'. / ; |.' ' : || | '`--' ' : |: : :
\ \ .' `--'---' '---' ; |.' ' : | ; |.' | | :
`---` '---' ; |.' '---' `---'.|
'---' `---`
""")
shape = '\033[34m' + "[" + '\033[91m' + "+" + '\033[34m' + "]"
print(str(shape) + '\033[91m' + " My website : " + "\033[32m" + "https://rdkgt7us.000webhostapp.com/")
print(str(shape) + '\033[91m' + " My instgram : " + "\033[32m" + "r_d515\n")
if len(sys.argv) != 2:
print("")
sys.exit(1)
ip = sys.argv[1]
url = f"http://ip-api.com/json/{ip}"
response = requests.get(url)
data = response.json()
if data["status"] == "success":
latitude = data["lat"]
longitude = data["lon"]
city = data["city"]
country = data["country"]
isp = data["isp"]
status = data["status"]
timezone = data["timezone"]
AS = data["as"]
org = data["org"]
print(str(shape) + '\033[91m'+" status:" + "\033[32m" + f" {status}")
print(str(shape) + '\033[91m'+" ISP:" + "\033[32m" + f" {isp} "+'\033[91m' + "as " + "\033[32m" + f"{AS}")
print(str(shape) + '\033[91m'+" oragainztions:" + "\033[32m" + f" {org}")
print(str(shape) + '\033[91m' +f" Location:" + "\033[32m" + f" {city} , {country}")
print(str(shape) + '\033[91m'+" timezone:" + "\033[32m" + f" {timezone} ")
print(str(shape) + '\033[91m' + f" Latitude:"+ "\033[32m" + f"{latitude}," '\033[91m' + "Longitude:" "\033[32m" + f"{longitude}")
else:
status = data["status"]
print('\033[91m'+"status:" + "\033[32m" + f" {status}\n")
print('\033[91m' + "Invalid IPv4 address or geolocation not available!!.")
print("try type (ip)/24 OR don't make a space")