This commit is contained in:
7
dyndns/utils.py
Normal file
7
dyndns/utils.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from urllib.request import urlopen, Request
|
||||
|
||||
def get_public_ip() -> str:
|
||||
url = "http://v4.ipv6-test.com/api/myip.php"
|
||||
request = Request(url)
|
||||
with urlopen(request) as request:
|
||||
return request.read().decode()
|
Reference in New Issue
Block a user