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

Try to discover public IP

parent 04640c07
...@@ -14,6 +14,7 @@ setup( ...@@ -14,6 +14,7 @@ setup(
"peewee>2.10.1", "peewee>2.10.1",
"click>=7.0", "click>=7.0",
"dnspython", "dnspython",
"miniupnpc",
], ],
entry_points={ entry_points={
"console_scripts": ["urlchecker=urlchecker_cli:runUrlChecker "] "console_scripts": ["urlchecker=urlchecker_cli:runUrlChecker "]
......
...@@ -6,6 +6,7 @@ import traceback ...@@ -6,6 +6,7 @@ import traceback
import time import time
from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter from forcediphttpsadapter.adapters import ForcedIPHTTPSAdapter
import dns.resolver import dns.resolver
import miniupnpc
__version__ = "0.0.3" __version__ = "0.0.3"
...@@ -109,6 +110,12 @@ class WebBot: ...@@ -109,6 +110,12 @@ class WebBot:
myresolver = dns.resolver.Resolver() myresolver = dns.resolver.Resolver()
print("Resolvers", myresolver.nameservers) print("Resolvers", myresolver.nameservers)
u = miniupnpc.UPnP()
u.discoverdelay = 200
u.discover()
u.selectigd()
print("external ip address: {}".format(u.externalipaddress()))
try: try:
self.check(url) self.check(url)
except KeyboardInterrupt: 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