PublicHD cache description call

This commit is contained in:
Ruud
2013-09-03 20:21:49 +02:00
parent b5993bcc21
commit 4cfa79488f
@@ -68,14 +68,21 @@ class PublicHD(TorrentMagnetProvider):
def getMoreInfo(self, item): def getMoreInfo(self, item):
try: cache_key = 'publichd.%s' % item['id']
full_description = self.getCache('publichd.%s' % item['id'], item['detail_url'], cache_timeout = 25920000) description = self.getCache(cache_key)
html = BeautifulSoup(full_description)
nfo_pre = html.find('div', attrs = {'id':'torrmain'}) if not description:
description = toUnicode(nfo_pre.text) if nfo_pre else ''
except: try:
log.error('Failed getting more info for %s', item['name']) full_description = self.urlopen(item['detail_url'], cache_timeout = 25920000)
description = '' html = BeautifulSoup(full_description)
nfo_pre = html.find('div', attrs = {'id':'torrmain'})
description = toUnicode(nfo_pre.text) if nfo_pre else ''
except:
log.error('Failed getting more info for %s', item['name'])
description = ''
self.setCache(cache_key, description)
item['description'] = description item['description'] = description
return item return item