fix fetching description
This commit is contained in:
parent
d864233a91
commit
171722fce3
1 changed files with 4 additions and 1 deletions
|
|
@ -22,6 +22,7 @@ from logging import warning, debug
|
|||
from weboob.tools.misc import html2text
|
||||
from weboob.tools.browser import BasePage
|
||||
from weboob.capabilities.torrent import Torrent
|
||||
from weboob.capabilities.base import NotLoaded
|
||||
|
||||
|
||||
__all__ = ['TorrentsPage']
|
||||
|
|
@ -168,7 +169,9 @@ class TorrentsPage(BasePage):
|
|||
body = html2text(self.browser.parser.tostring(body_t[0]))
|
||||
|
||||
if title and body:
|
||||
torrent.description += '%s\n\n%s\n' % (title, body)
|
||||
if torrent.description is NotLoaded:
|
||||
torrent.description = u''
|
||||
torrent.description += u'%s\n\n%s\n' % (title, body)
|
||||
|
||||
div = self.document.getroot().cssselect('div#files_%s' % torrent.id)
|
||||
if div:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue