mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get Books: Fix DRM status indicators for Kobo and Diesel stores. Fix smashwords not returning results. Fixes #993755 (Searching for ebooks on Smashwords returns no result)
This commit is contained in:
commit
f0c0a56385
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user