Skip to content

Commit

Permalink
Update start.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SudoLite committed Apr 16, 2022
1 parent 22e89cc commit c2e8eb5
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions start.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,9 @@
with open(__dir__ / "config.json") as f:
con = load(f)

def getMyIPAddress():
global __ip__
if __ip__:
return __ip__
with suppress(Exception):
return get('https://api.my-ip.io/ip', timeout=.1).text
with suppress(Exception):
return get('https://ipwhois.app/json/', timeout=.1).json()["ip"]
with suppress(Exception):
return get('https://ipinfo.io/json', timeout=.1).json()["ip"]
with suppress(Exception):
return ProxyTools.Patterns.IP.search(get('http://checkip.dyndns.org/', timeout=.1).text)
with suppress(Exception):
return ProxyTools.Patterns.IP.search(get('https://spaceiran.com/myip/', timeout=.1).text)
with suppress(Exception):
return get('https://ip.42.pl/raw', timeout=.1).text
return getMyIPAddress()
with socket(AF_INET, SOCK_DGRAM) as s:
s.connect(("8.8.8.8", 80))
__ip__ = s.getsockname()[0]


class bcolors:
Expand Down

0 comments on commit c2e8eb5

Please sign in to comment.