def __init__(self): log('loading trackerListUpdater') self.autoRetry = False self.hours = 0 self.minutes = 5 self.seconds = 0 self.updateBack = False
def updateTrackers(self): try: self.rawls = urlopen(TRACKERS_URL).read() except: self.rawls = '' if len(self.rawls) < 20: log('failed to get trackers list' + ('; retrying in ' + ' and '.join([ str(getattr(self, t)) + ' ' + t for t in ('hours', 'minutes', 'seconds') if getattr(self, t) != 0 ]) if self.autoRetry else '')) if self.autoRetry: self.startTimer() return #TODO: autoupload user trackers, if they are not already in the list if self.updateBack: try: self.deadTrackers = dict.fromKeys( urlopen(DEAD_TRACKERS_URL).read().split('\n')) except: log('can\'t get dead trackers list: unenabeling update back') self.deadTrackers = {} self.trackers = self.rawls.split('\n') log('found ' + str(len(self.trackers)) + ' trackers; adding them to every found torrent...') self.updateTorrents()
def updateTrackers(self): try: self.rawls = urlopen(TRACKERS_URL).read() except: self.rawls='' if len(self.rawls) < 20: log('failed to get trackers list' + ('; retrying in ' + ' and '.join([str(getattr(self, t)) + ' ' + t for t in ('hours', 'minutes', 'seconds') if getattr(self, t) != 0]) if self.autoRetry else '')) if self.autoRetry: self.startTimer() return #TODO: autoupload user trackers, if they are not already in the list if self.updateBack: try: self.deadTrackers = dict.fromKeys(urlopen(DEAD_TRACKERS_URL).read().split('\n')) except: log('can\'t get dead trackers list: unenabeling update back') self.deadTrackers = {} self.trackers=self.rawls.split('\n') log('found ' + str(len(self.trackers)) + ' trackers; adding them to every found torrent...') self.updateTorrents()