From 55ff7463b5caa5b5b8adb08ac022df4b20a5cc72 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 25 May 2008 12:29:24 +0200 Subject: [PATCH] that can also be empty on mininova --- ox/mininova.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/ox/mininova.py b/ox/mininova.py index 908982c..c569e6a 100644 --- a/ox/mininova.py +++ b/ox/mininova.py @@ -109,16 +109,15 @@ class Mininova(Torrent): return Torrent.__init__(self) ratio = self.data['share ratio'].split(',') - 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 + self['seeder'] = -1 + self['leecher'] = -1 + if len(ratio) == 2: + val = intValue(ratio[0].replace(',','').strip()) + if val: + self['seeder'] = int(val) + val = intValue(ratio[1].replace(',','').strip()) + if val: + self['leecher'] = int(val) val = intValue(self.data['downloads'].replace(',','').strip()) if val: self['downloaded'] = int(val)