mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: ebooks.com drm status.
This commit is contained in:
parent
7680faa48f
commit
8c6d4e66d3
@ -70,6 +70,11 @@ class EbookscomStore(BasicStoreConfig, StorePlugin):
|
|||||||
pdata = pdoc.xpath('//table[@class="price"]/tr/td/text()')
|
pdata = pdoc.xpath('//table[@class="price"]/tr/td/text()')
|
||||||
if len(pdata) >= 2:
|
if len(pdata) >= 2:
|
||||||
price = pdata[1]
|
price = pdata[1]
|
||||||
|
drm = False
|
||||||
|
for sec in ('Printing', 'Copying', 'Lending'):
|
||||||
|
if pdoc.xpath('boolean(//div[@class="formatTableInner"]//table//tr[contains(th, "%s") and contains(td, "Off")])' % sec):
|
||||||
|
drm = True
|
||||||
|
break
|
||||||
if not price:
|
if not price:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -91,5 +96,6 @@ class EbookscomStore(BasicStoreConfig, StorePlugin):
|
|||||||
s.author = author.strip()
|
s.author = author.strip()
|
||||||
s.price = price.strip()
|
s.price = price.strip()
|
||||||
s.detail_item = '?url=http://www.ebooks.com/cj.asp?IID=' + id.strip() + '&cjsku=' + id.strip()
|
s.detail_item = '?url=http://www.ebooks.com/cj.asp?IID=' + id.strip() + '&cjsku=' + id.strip()
|
||||||
|
s.drm = drm
|
||||||
|
|
||||||
yield s
|
yield s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user