From 4223211241b1dc1850cd9caa741213da5a861669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Fri, 4 Nov 2011 19:01:12 +0100 Subject: [PATCH] fix format detection in ebookpoint plugin --- src/calibre/gui2/store/stores/ebookpoint_plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/store/stores/ebookpoint_plugin.py b/src/calibre/gui2/store/stores/ebookpoint_plugin.py index e295c552a2..98f0c9685f 100644 --- a/src/calibre/gui2/store/stores/ebookpoint_plugin.py +++ b/src/calibre/gui2/store/stores/ebookpoint_plugin.py @@ -44,6 +44,7 @@ class EbookpointStore(BasicStoreConfig, StorePlugin): def search(self, query, max_results=10, timeout=60): url = 'http://ebookpoint.pl/search.scgi?szukaj=' + urllib.quote(query) + '&serwisyall=0&x=0&y=0' + ebook_string = 'eBook.' br = browser() @@ -60,12 +61,13 @@ class EbookpointStore(BasicStoreConfig, StorePlugin): cover_url = ''.join(data.xpath('.//a[@class="cover"]/img/@src')) title = ''.join(data.xpath('.//h3/a/text()')) + title = re.sub(ebook_string, '', title) author = ''.join(data.xpath('.//p[@class="author"]/text()')) price = ''.join(data.xpath('.//p[@class="price"]/ins/text()')) with closing(br.open(id.strip(), timeout=timeout)) as nf: idata = html.fromstring(nf.read()) - formats = ', '.join(idata.xpath('//div[@class="col-left"]/h2/@class')) + formats = ', '.join(idata.xpath('//div[@class="col-left"]/h2[contains(., "' + ebook_string + '")]/@class')) counter -= 1