mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Fix #792762 (book not available on kindlle)
This commit is contained in:
commit
07001c633a
@ -75,15 +75,18 @@ class AmazonUKKindleStore(AmazonKindleStore):
|
|||||||
s.title = title.strip()
|
s.title = title.strip()
|
||||||
s.price = price.strip()
|
s.price = price.strip()
|
||||||
s.detail_item = asin.strip()
|
s.detail_item = asin.strip()
|
||||||
s.formats = 'Kindle'
|
s.formats = ''
|
||||||
|
|
||||||
if is_shot:
|
if is_shot:
|
||||||
# Amazon UK does not include the author on the grid layout
|
# Amazon UK does not include the author on the grid layout
|
||||||
s.author = ''
|
s.author = ''
|
||||||
self.get_details(s, timeout)
|
self.get_details(s, timeout)
|
||||||
|
if s.formats != 'Kindle':
|
||||||
|
continue
|
||||||
else:
|
else:
|
||||||
author = ''.join(data.xpath('.//div[@class="productTitle"]/span[@class="ptBrand"]/text()'))
|
author = ''.join(data.xpath('.//div[@class="productTitle"]/span[@class="ptBrand"]/text()'))
|
||||||
s.author = author.split(' by ')[-1].strip()
|
s.author = author.split(' by ')[-1].strip()
|
||||||
|
s.formats = 'Kindle'
|
||||||
|
|
||||||
yield s
|
yield s
|
||||||
|
|
||||||
@ -99,6 +102,9 @@ class AmazonUKKindleStore(AmazonKindleStore):
|
|||||||
idata = html.fromstring(nf.read())
|
idata = html.fromstring(nf.read())
|
||||||
if not search_result.author:
|
if not search_result.author:
|
||||||
search_result.author = ''.join(idata.xpath('//div[@class="buying" and contains(., "Author")]/a/text()'))
|
search_result.author = ''.join(idata.xpath('//div[@class="buying" and contains(., "Author")]/a/text()'))
|
||||||
|
is_kindle = idata.xpath('boolean(//div[@class="buying"]/h1/span/span[contains(text(), "Kindle Edition")])')
|
||||||
|
if is_kindle:
|
||||||
|
search_result.formats = 'Kindle'
|
||||||
if idata.xpath('boolean(//div[@class="content"]//li/b[contains(text(), "' +
|
if idata.xpath('boolean(//div[@class="content"]//li/b[contains(text(), "' +
|
||||||
self.drm_search_text + '")])'):
|
self.drm_search_text + '")])'):
|
||||||
if idata.xpath('boolean(//div[@class="content"]//li[contains(., "' +
|
if idata.xpath('boolean(//div[@class="content"]//li[contains(., "' +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user