diff --git a/ox/mininova.py b/ox/mininova.py index 948197b..908982c 100644 --- a/ox/mininova.py +++ b/ox/mininova.py @@ -109,9 +109,21 @@ class Mininova(Torrent): return Torrent.__init__(self) ratio = self.data['share ratio'].split(',') - self['seeder'] = int(intValue(ratio[0].replace(',','').strip())) - self['leecher'] = int(intValue(ratio[1].replace(',','').strip())) - self['downloaded'] = int(intValue(self.data['downloads'].replace(',','').strip())) + val = intValue(ratio[0].replace(',','').strip()) + if val: + self['seeder'] = int(val) + else: + self['seeder'] = -1 + val = intValue(ratio[1].replace(',','').strip()) + if val: + self['leecher'] = int(val) + else: + self['leecher'] = -1 + val = intValue(self.data['downloads'].replace(',','').strip()) + if val: + self['downloaded'] = int(val) + else: + self['downloaded'] = -1 published = self.data['added on'] published = published.split(' +')[0] self['published'] = datetime.strptime(published, "%a, %d %b %Y %H:%M:%S")