mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
detect formats in cdp
This commit is contained in:
parent
a6048a6ba7
commit
1c5cb39141
@ -62,6 +62,11 @@ class CdpStore(BasicStoreConfig, StorePlugin):
|
|||||||
author = ''.join(data.xpath('.//div[@class="product-description"]//ul[@class="taxons"]/li[2]/a/text()'))
|
author = ''.join(data.xpath('.//div[@class="product-description"]//ul[@class="taxons"]/li[2]/a/text()'))
|
||||||
price = ''.join(data.xpath('.//span[@itemprop="price"]/text()'))
|
price = ''.join(data.xpath('.//span[@itemprop="price"]/text()'))
|
||||||
|
|
||||||
|
with closing(br.open(id.strip(), timeout=timeout/4)) as nf:
|
||||||
|
idata = html.fromstring(nf.read())
|
||||||
|
formats = ', '.join(idata.xpath('//div[@id="product-bonus"]/div/ul/li/text()'))
|
||||||
|
|
||||||
|
|
||||||
counter -= 1
|
counter -= 1
|
||||||
|
|
||||||
s = SearchResult()
|
s = SearchResult()
|
||||||
@ -71,7 +76,7 @@ class CdpStore(BasicStoreConfig, StorePlugin):
|
|||||||
s.price = price
|
s.price = price
|
||||||
s.detail_item = id.strip()
|
s.detail_item = id.strip()
|
||||||
s.drm = SearchResult.DRM_UNLOCKED
|
s.drm = SearchResult.DRM_UNLOCKED
|
||||||
#s.formats = formats.upper().strip()
|
s.formats = formats.upper()
|
||||||
|
|
||||||
yield s
|
yield s
|
||||||
if not doc.xpath('//span[@class="next"]/a'):
|
if not doc.xpath('//span[@class="next"]/a'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user