From 091298f90e3e4d9468c59fb46c9ec16aa0c061f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Sun, 6 Aug 2023 14:49:41 +0200 Subject: [PATCH 1/3] Get books: virtualo price lookup fix --- src/calibre/gui2/store/stores/virtualo_plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/store/stores/virtualo_plugin.py b/src/calibre/gui2/store/stores/virtualo_plugin.py index b024029008..0229a6c94f 100644 --- a/src/calibre/gui2/store/stores/virtualo_plugin.py +++ b/src/calibre/gui2/store/stores/virtualo_plugin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -store_version = 11 # Needed for dynamic plugin loading +store_version = 12 # Needed for dynamic plugin loading __license__ = 'GPL 3' __copyright__ = '2011-2023, Tomasz Długosz ' @@ -74,7 +74,7 @@ class VirtualoStore(BasicStoreConfig, StorePlugin): if not id: continue - price = ''.join(data.xpath('.//div[@class="info"]//div[@class="price"]/text()')) + price = ''.join(data.xpath('.//div[@class="info"]//div[@class="price"]/div/text()|.//div[@class="info"]//div[@class="price price--no-promo"]/div/text()')) cover_url = ''.join(data.xpath('.//img[@class="cover"]/@src')) title = ''.join(data.xpath('.//h3[@class="title"]/a//text()')) author = ', '.join(data.xpath('.//div[@class="info"]//div[@class="authors"]/a//text()')) From 55c4b16e6dc2ebec40c3f570ef1f6bf0b12f3f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Mon, 7 Aug 2023 15:37:54 +0200 Subject: [PATCH 2/3] Get books: update empik store --- src/calibre/gui2/store/stores/empik_plugin.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/store/stores/empik_plugin.py b/src/calibre/gui2/store/stores/empik_plugin.py index 8a2c4c5008..3280b2f2ce 100644 --- a/src/calibre/gui2/store/stores/empik_plugin.py +++ b/src/calibre/gui2/store/stores/empik_plugin.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -store_version = 9 # Needed for dynamic plugin loading +store_version = 10 # Needed for dynamic plugin loading __license__ = 'GPL 3' -__copyright__ = '2011-2019, Tomasz Długosz ' +__copyright__ = '2011-2023, Tomasz Długosz ' __docformat__ = 'restructuredtext en' from base64 import b64encode @@ -68,13 +68,13 @@ class EmpikStore(BasicStoreConfig, StorePlugin): if counter <= 0: break - id = ''.join(data.xpath('.//div[@class="name"]/a/@href')) + id = ''.join(data.xpath('.//a[@class="img seoImage"]/@href')) if not id: continue + title = ''.join(data.xpath('.//h2[@class="product-title"]/a/strong/text()')) + author = ', '.join(data.xpath('.//a[@class="smartAuthor "]/text()')) cover_url = ''.join(data.xpath('.//a/img[@class="lazy"]/@lazy-img')) - author = ', '.join(data.xpath('.//a[@class="smartAuthor"]/text()')) - title = ''.join(data.xpath('.//div[@class="name"]/a/@title')) price = ''.join(data.xpath('.//div[@class="price ta-price-tile "]/text()')) # with closing(br.open('https://empik.com' + id.strip(), timeout=timeout/4)) as nf: From 53bc68227623147a1470caefce1d0214958c037e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C5=82ugosz?= Date: Mon, 7 Aug 2023 15:45:32 +0200 Subject: [PATCH 3/3] Get books: show only ebooks in legimi --- src/calibre/gui2/store/stores/legimi_plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/store/stores/legimi_plugin.py b/src/calibre/gui2/store/stores/legimi_plugin.py index feecf8baf2..6d23ea4f23 100644 --- a/src/calibre/gui2/store/stores/legimi_plugin.py +++ b/src/calibre/gui2/store/stores/legimi_plugin.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals -store_version = 11 # Needed for dynamic plugin loading +store_version = 12 # Needed for dynamic plugin loading __license__ = 'GPL 3' __copyright__ = '2011-2023, Tomasz Długosz ' @@ -57,7 +57,7 @@ class LegimiStore(BasicStoreConfig, StorePlugin): d.exec() def search(self, query, max_results=10, timeout=60): - url = 'https://www.legimi.pl/ebooki/?sort=score&searchphrase=' + quote_plus(query) + url = 'https://www.legimi.pl/ebooki/?sort=score&filters=ebooks&searchphrase=' + quote_plus(query) br = browser()