mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: Diesel drm status.
This commit is contained in:
parent
ebf4ee8fed
commit
7680faa48f
@ -74,6 +74,13 @@ class DieselEbooksStore(BasicStoreConfig, StorePlugin):
|
|||||||
price_elem = data.xpath('//td[@class="price"]/text()')
|
price_elem = data.xpath('//td[@class="price"]/text()')
|
||||||
if price_elem:
|
if price_elem:
|
||||||
price = price_elem[0]
|
price = price_elem[0]
|
||||||
|
|
||||||
|
with closing(br.open('http://www.diesel-ebooks.com/item/' + id.strip(), timeout=timeout/4)) as nf:
|
||||||
|
idata = html.fromstring(nf.read())
|
||||||
|
if idata.xpath('boolean(//table[@class="format-info"]//tr[contains(th, "DRM") and contains(td, "No")])'):
|
||||||
|
drm = False
|
||||||
|
else:
|
||||||
|
drm = True
|
||||||
|
|
||||||
counter -= 1
|
counter -= 1
|
||||||
|
|
||||||
@ -83,5 +90,6 @@ class DieselEbooksStore(BasicStoreConfig, StorePlugin):
|
|||||||
s.author = author.strip()
|
s.author = author.strip()
|
||||||
s.price = price.strip()
|
s.price = price.strip()
|
||||||
s.detail_item = '/item/' + id.strip()
|
s.detail_item = '/item/' + id.strip()
|
||||||
|
s.drm = drm
|
||||||
|
|
||||||
yield s
|
yield s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user