Fix for spotweb date not available

This commit is contained in:
Ruud
2012-01-22 23:34:53 +01:00
parent c231c62417
commit e34b660e59
@@ -113,12 +113,17 @@ class Newznab(NZBProvider, RSS):
results = []
for nzb in nzbs:
date = ''
size = 0
for item in nzb:
if item.attrib.get('name') == 'size':
size = item.attrib.get('value')
elif item.attrib.get('name') == 'usenetdate':
date = item.attrib.get('value')
if date is '': log.info('Date not parsed properly or not available for %s: %s' % (host, self.getTextElement(nzb, "title")))
if size is 0: log.info('Size not parsed properly or not available for %s: %s' % (host, self.getTextElement(nzb, "title")))
id = self.getTextElement(nzb, "guid").split('/')[-1:].pop()
new = {
'id': id,