Skip tracker announce on incalid url pattern

This commit is contained in:
shortcutme 2018-07-10 03:34:06 +02:00
parent 71806e6f95
commit 86e4679e04
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -144,7 +144,10 @@ class SiteAnnouncer(object):
def announceTracker(self, tracker, mode="start", num_want=10):
s = time.time()
protocol, address = tracker.split("://")
if "://" not in tracker:
self.site.log.warning("Tracker %s error: Invalid address" % tracker)
return False
protocol, address = tracker.split("://", 1)
if tracker not in self.stats:
self.stats[tracker] = {"status": "", "num_request": 0, "num_success": 0, "num_error": 0, "time_request": 0}