support getting more info.
This commit is contained in:
@@ -124,12 +124,22 @@ class ILoveTorrents(TorrentMagnetProvider):
|
|||||||
def getDomain(self, url = ''):
|
def getDomain(self, url = ''):
|
||||||
return cleanHost(self.domain).rstrip('/') + url
|
return cleanHost(self.domain).rstrip('/') + url
|
||||||
|
|
||||||
def getMoreInfo(self, item):
|
def getMoreInfo(self, item):
|
||||||
log.info('Getting more info')
|
cache_key = 'ilt.%s' % item['id']
|
||||||
full_description = self.getCache('ilt.%s' % item['id'], item['detail_url'], cache_timeout = 25920000)
|
description = self.getCache(cache_key)
|
||||||
html = BeautifulSoup(full_description)
|
|
||||||
nfo_pre = html.find('div', attrs = {'class':'nfo'})
|
if not description:
|
||||||
description = toUnicode(nfo_pre.text) if nfo_pre else ''
|
|
||||||
|
try:
|
||||||
|
full_description = self.getHTMLData(item['detail_url'], opener = self.login_opener)
|
||||||
|
html = BeautifulSoup(full_description, "html5lib")
|
||||||
|
nfo_pre = html.find('td', attrs = {'class':'main'}).findAll('table')[1].findAll('td')[5]
|
||||||
|
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, timeout = 25920000)
|
||||||
|
|
||||||
item['description'] = description
|
item['description'] = description
|
||||||
return item
|
return item
|
||||||
|
|||||||
Reference in New Issue
Block a user