[piratebay] unescape title
This commit is contained in:
parent
5e247db743
commit
a7b42940b0
2 changed files with 6 additions and 2 deletions
|
|
@ -219,6 +219,8 @@ dict_hex = {'á': u'á',
|
||||||
'À': u'À',
|
'À': u'À',
|
||||||
'â': u'â',
|
'â': u'â',
|
||||||
'É': u'É',
|
'É': u'É',
|
||||||
|
'ë': u'ë',
|
||||||
|
'ô': u'ô',
|
||||||
'ç': u'ç'
|
'ç': u'ç'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ from weboob.tools.browser import BasePage,BrokenPageError
|
||||||
from weboob.capabilities.torrent import Torrent
|
from weboob.capabilities.torrent import Torrent
|
||||||
from weboob.capabilities.base import NotAvailable, NotLoaded
|
from weboob.capabilities.base import NotAvailable, NotLoaded
|
||||||
|
|
||||||
|
from html2text import unescape
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['TorrentsPage']
|
__all__ = ['TorrentsPage']
|
||||||
|
|
||||||
|
|
@ -50,7 +52,7 @@ class TorrentsPage(BasePage):
|
||||||
td = tr.getchildren()[1]
|
td = tr.getchildren()[1]
|
||||||
div = td.getchildren()[0]
|
div = td.getchildren()[0]
|
||||||
link = div.find('a').attrib['href']
|
link = div.find('a').attrib['href']
|
||||||
title = unicode(div.find('a').text)
|
title = unicode(unescape(div.find('a').text))
|
||||||
idt = link.split('/')[2]
|
idt = link.split('/')[2]
|
||||||
|
|
||||||
a = td.getchildren()[1]
|
a = td.getchildren()[1]
|
||||||
|
|
@ -80,7 +82,7 @@ class TorrentPage(BasePage):
|
||||||
magnet = NotAvailable
|
magnet = NotAvailable
|
||||||
for div in self.document.getiterator('div'):
|
for div in self.document.getiterator('div'):
|
||||||
if div.attrib.get('id', '') == 'title':
|
if div.attrib.get('id', '') == 'title':
|
||||||
title = unicode(div.text.strip())
|
title = unicode(unescape(div.text.strip()))
|
||||||
elif div.attrib.get('class', '') == 'download':
|
elif div.attrib.get('class', '') == 'download':
|
||||||
for link in self.parser.select(div, 'a'):
|
for link in self.parser.select(div, 'a'):
|
||||||
href = link.attrib.get('href', '')
|
href = link.attrib.get('href', '')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue