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
@ -75,6 +75,13 @@ class DieselEbooksStore(BasicStoreConfig, StorePlugin):
|
||||
if price_elem:
|
||||
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
|
||||
|
||||
s = SearchResult()
|
||||
@ -83,5 +90,6 @@ class DieselEbooksStore(BasicStoreConfig, StorePlugin):
|
||||
s.author = author.strip()
|
||||
s.price = price.strip()
|
||||
s.detail_item = '/item/' + id.strip()
|
||||
s.drm = drm
|
||||
|
||||
yield s
|
||||
|
Loading…
x
Reference in New Issue
Block a user