Commit 9686bf06 authored by Romain Courteaud's avatar Romain Courteaud

Try to discover public IP

parent 04640c07
......@@ -14,6 +14,7 @@ setup(
"peewee>2.10.1",
"click>=7.0",
"dnspython",
"miniupnpc",
],
entry_points={
"console_scripts": ["urlchecker=urlchecker_cli:runUrlChecker "]
......
......@@ -6,6 +6,7 @@ import traceback
import time
from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter
import dns.resolver
import miniupnpc
__version__ = "0.0.3"
......@@ -109,6 +110,12 @@ class WebBot:
myresolver = dns.resolver.Resolver()
print("Resolvers", myresolver.nameservers)
u = miniupnpc.UPnP()
u.discoverdelay = 200
u.discover()
u.selectigd()
print("external ip address: {}".format(u.externalipaddress()))
try:
self.check(url)
except KeyboardInterrupt:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment