mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Bettwe cover thumbnails for the Amazon store plugin
This commit is contained in:
parent
460cb932af
commit
79f2d3bd4d
@ -154,6 +154,13 @@ class AmazonKindleStore(StorePlugin):
|
|||||||
cover_img = data.xpath('//div[@class="productImage"]/a[@href="%s"]/img/@src' % asin_href)
|
cover_img = data.xpath('//div[@class="productImage"]/a[@href="%s"]/img/@src' % asin_href)
|
||||||
if cover_img:
|
if cover_img:
|
||||||
cover_url = cover_img[0]
|
cover_url = cover_img[0]
|
||||||
|
parts = cover_url.split('/')
|
||||||
|
bn = parts[-1]
|
||||||
|
f, _, ext = bn.rpartition('.')
|
||||||
|
if '_' in f:
|
||||||
|
bn = f.partition('_')[0]+'_SL160_.'+ext
|
||||||
|
parts[-1] = bn
|
||||||
|
cover_url = '/'.join(parts)
|
||||||
|
|
||||||
title = ''.join(data.xpath('div[@class="productTitle"]/a/text()'))
|
title = ''.join(data.xpath('div[@class="productTitle"]/a/text()'))
|
||||||
author = ''.join(data.xpath('div[@class="productTitle"]/span[@class="ptBrand"]/text()'))
|
author = ''.join(data.xpath('div[@class="productTitle"]/span[@class="ptBrand"]/text()'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user