From b10dc544bd4c289ecbd81da30d92575db6234cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Wed, 9 Oct 2013 00:02:51 +0200 Subject: [PATCH] wolnelektury plugin: add download capability --- src/calibre/gui2/store/stores/wolnelektury_plugin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/store/stores/wolnelektury_plugin.py b/src/calibre/gui2/store/stores/wolnelektury_plugin.py index f3f7db5387..09f63af508 100644 --- a/src/calibre/gui2/store/stores/wolnelektury_plugin.py +++ b/src/calibre/gui2/store/stores/wolnelektury_plugin.py @@ -60,17 +60,20 @@ class WolneLekturyStore(BasicStoreConfig, StorePlugin): title = ''.join(data.xpath('.//div[@class="title"]/a[1]/text()')) author = ', '.join(data.xpath('.//div[@class="mono author"]/a/text()')) price = '0,00 zł' - formats = ', '.join(data.xpath('.//div[@class="book-box-formats mono"]/span/a/text()')) counter -= 1 s = SearchResult() + for link in data.xpath('.//div[@class="book-box-formats mono"]/span/a'): + ext = ''.join(link.xpath('./text()')) + href = 'http://wolnelektury.pl' + link.get('href') + s.downloads[ext] = href s.cover_url = 'http://wolnelektury.pl' + cover_url.strip() s.title = title.strip() s.author = author s.price = price s.detail_item = 'http://wolnelektury.pl' + id - s.formats = formats.upper().strip() + s.formats = ', '.join(s.downloads.keys()) s.drm = SearchResult.DRM_UNLOCKED yield s