[weboob] Patches correctifs pour le formatter json et pour le module youjizz

Vincent Texier vit at free.fr
Sun Dec 22 15:24:40 CET 2013


Bonjour,

ci-joint deux patch pour weboob.

Version 0.h de développement.
Révision : 6aed4931dd8545059e8c2cd4776bdc49d810a3a2
Système : Ubuntu 12.04 32bits
Python 2.7.3

Hope this helps !

Vincent.


---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
http://www.avast.com
-------------- next part --------------
commit 4e964ec9b45b4c2bfe26bf8f03d23f1da4ec31f9
Author: Vincent Texier <vit at ubuntu-vm1.(none)>
Date:   Sun Dec 22 15:11:31 2013 +0100

    Fixed thumbnail field returning always "id" with json formatter
    
    Version development 0.h

diff --git a/weboob/tools/application/formatters/json.py b/weboob/tools/application/formatters/json.py
index ea2df55..e9ae235 100644
--- a/weboob/tools/application/formatters/json.py
+++ b/weboob/tools/application/formatters/json.py
@@ -36,7 +36,7 @@ class Encoder(json.JSONEncoder):
                 dct = obj.to_dict()
             except AttributeError:
                 return str(obj)
-            for z in dct:
+            for z in dct.itervalues():
                 return z
 
 
-------------- next part --------------
commit 0d8846e1c6acfad4b3637b53098f5aacdaa9c8a5
Author: Vincent Texier <vit at ubuntu-vm1.(none)>
Date:   Sun Dec 22 15:14:54 2013 +0100

    Fix bug thumbnail field always return "spacer.gif" in youjizz module

diff --git a/modules/youjizz/pages/index.py b/modules/youjizz/pages/index.py
index 8641a5b..f6492dd 100644
--- a/modules/youjizz/pages/index.py
+++ b/modules/youjizz/pages/index.py
@@ -41,7 +41,7 @@ class IndexPage(BasePage):
 
             video = YoujizzVideo(_id)
 
-            video.thumbnail = Thumbnail(unicode(span.find('.//img').attrib['src']))
+            video.thumbnail = Thumbnail(unicode(span.find('.//img').attrib['data-original']))
 
             title_el = self.parser.select(span, 'span#title1', 1)
             video.title = to_unicode(title_el.text.strip())


More information about the weboob mailing list