If no port defined in tracker url assume it is port 80; fix #1917

This commit is contained in:
rllola 2019-03-09 18:41:50 +01:00
parent 174e8d3c19
commit fb836fcf6f

View file

@ -172,7 +172,11 @@ class SiteAnnouncer(object):
if "://" not in tracker or not re.match("^[A-Za-z0-9:/\\.#-]+$", tracker):
return None
protocol, address = tracker.split("://", 1)
ip, port = address.rsplit(":", 1)
try:
ip, port = address.rsplit(":", 1)
except ValueError as err:
ip = address
port = 80
back = {}
back["protocol"] = protocol
back["address"] = address