[weboob] [PATCH 2/2] [ina] Fix bug bad characters in titles

Vincent Texier vit at free.fr
Sun Jun 8 19:34:44 CEST 2014


The parser returns latin1 unicode titles we have to convert to utf-8

Signed-off-by: Vincent Texier <vit at free.fr>
---
 modules/ina/pages/search.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/ina/pages/search.py b/modules/ina/pages/search.py
index 06f4611..e02b093 100644
--- a/modules/ina/pages/search.py
+++ b/modules/ina/pages/search.py
@@ -47,8 +47,7 @@ class SearchPage(BasePage):
 
             video.thumbnail = BaseImage(u'http://boutique.ina.fr%s' % url)
             video.thumbnail.url = video.thumbnail.id
-
-            video.title = unicode(self.parser.select(li, 'p.titre', 1).text)
+            video.title = unicode(self.parser.select(li, 'p.titre', 1).text).encode('latin1').decode('utf8')
 
             date = self.parser.select(li, 'p.date', 1).text
             day, month, year = [int(s) for s in date.split('/')]
-- 
1.9.1




More information about the weboob mailing list