[weboob] [PATCH 2/2] [piratebay] handle fuzzy dates

Matthieu Weber mweber+weboob at free.fr
Tue Mar 22 19:47:42 CET 2016


Signed-off-by: Matthieu Weber <mweber+weboob at free.fr>
---
 modules/piratebay/pages/torrents.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/piratebay/pages/torrents.py b/modules/piratebay/pages/torrents.py
index 06170c9..cd10c75 100644
--- a/modules/piratebay/pages/torrents.py
+++ b/modules/piratebay/pages/torrents.py
@@ -38,7 +38,7 @@ class TorrentsPage(HTMLPage):
             obj_name = Regexp(CleanText('./td[2]/div/a[@class="detLink"]/@title'),
                               r'Details for (.*)$', '\\1')
             obj_magnet = CleanText('./td[2]/a[title="Download this torrent using magnet"]/@href')
-            obj_date = Date(Regexp(CleanText('./td[2]/font'), r'Uploaded (\d{2}-\d{2} \d{4})', '\\1'))
+            obj_date = Date(Regexp(CleanText('./td[2]/font'), r'Uploaded ([^,]+),', '\\1'), fuzzy=True)
             obj_seeders = Type(CleanText('./td[3]'), type=int)
             obj_leechers = Type(CleanText('./td[4]'), type=int)
 
-- 
2.1.4



More information about the weboob mailing list