mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Store: Fix Google Books plugin.
This commit is contained in:
parent
712d78ccc1
commit
f9c1c6e7f0
@ -68,8 +68,8 @@ class GoogleBooksStore(BasicStoreConfig, StorePlugin):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
title = ''.join(data.xpath('.//h3/a//text()'))
|
title = ''.join(data.xpath('.//h3/a//text()'))
|
||||||
authors = data.xpath('.//span[@class="gl"]//a//text()')
|
authors = data.xpath('.//span[@class="f"]//a//text()')
|
||||||
if authors[-1].strip().lower() in ('preview', 'read'):
|
if authors and authors[-1].strip().lower() in ('preview', 'read'):
|
||||||
authors = authors[:-1]
|
authors = authors[:-1]
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
@ -98,6 +98,8 @@ class GoogleBooksStore(BasicStoreConfig, StorePlugin):
|
|||||||
if not price.strip():
|
if not price.strip():
|
||||||
price = ''.join(doc.xpath('//div[@class="buy-container"]/a/text()'))
|
price = ''.join(doc.xpath('//div[@class="buy-container"]/a/text()'))
|
||||||
price = price.split('-')[-1]
|
price = price.split('-')[-1]
|
||||||
|
if 'view' in price.lower():
|
||||||
|
price = 'Unknown'
|
||||||
# No price set for this book.
|
# No price set for this book.
|
||||||
if not price.strip():
|
if not price.strip():
|
||||||
price = '$0.00'
|
price = '$0.00'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user