diff --git a/src/calibre/gui2/store/stores/diesel_ebooks_plugin.py b/src/calibre/gui2/store/stores/diesel_ebooks_plugin.py index 1d410e2c38..3991be554d 100644 --- a/src/calibre/gui2/store/stores/diesel_ebooks_plugin.py +++ b/src/calibre/gui2/store/stores/diesel_ebooks_plugin.py @@ -72,7 +72,7 @@ class DieselEbooksStore(BasicStoreConfig, StorePlugin): formats = ', '.join(data.xpath('.//div[@class="book-info"]//text()')).strip() a, b, formats = formats.partition('Format:') drm = SearchResult.DRM_LOCKED - if 'drm free' not in formats.lower(): + if 'drm free' in formats.lower(): drm = SearchResult.DRM_UNLOCKED diff --git a/src/calibre/gui2/store/stores/kobo_plugin.py b/src/calibre/gui2/store/stores/kobo_plugin.py index 249d59ec5c..c888c0a252 100644 --- a/src/calibre/gui2/store/stores/kobo_plugin.py +++ b/src/calibre/gui2/store/stores/kobo_plugin.py @@ -69,7 +69,7 @@ class KoboStore(BasicStoreConfig, StorePlugin): title = ''.join(data.xpath('.//div[@class="SCItemHeader"]/h1/a[1]/text()')) author = ', '.join(data.xpath('.//div[@class="SCItemSummary"]//span//a/text()')) - drm = data.xpath('boolean(.//span[@class="SCAvailibilityFormatsText" and contains(text(), "DRM")])') + drm = data.xpath('boolean(.//span[@class="SCAvailibilityFormatsText" and not(contains(text(), "DRM-Free"))])') counter -= 1 diff --git a/src/calibre/gui2/store/stores/smashwords_plugin.py b/src/calibre/gui2/store/stores/smashwords_plugin.py index 7a7e756a05..2c69417612 100644 --- a/src/calibre/gui2/store/stores/smashwords_plugin.py +++ b/src/calibre/gui2/store/stores/smashwords_plugin.py @@ -53,7 +53,7 @@ class SmashwordsStore(BasicStoreConfig, StorePlugin): counter = max_results with closing(br.open(url, timeout=timeout)) as f: doc = html.fromstring(f.read()) - for data in doc.xpath('//div[@id="pageCenterContent2"]//div[@class="bookCoverImg"]'): + for data in doc.xpath('//div[@id="pageCenterContent"]//div[@class="bookCoverImg"]'): if counter <= 0: break data = html.fromstring(html.tostring(data))