mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Store: eharlequin report DRM status.
This commit is contained in:
parent
8c6d4e66d3
commit
2b01f9ab68
@ -68,6 +68,12 @@ class EHarlequinStore(BasicStoreConfig, StorePlugin):
|
||||
price = ''.join(data.xpath('.//div[@class="ourprice"]/font/text()'))
|
||||
cover_url = ''.join(data.xpath('.//a[@href="%s"]/img/@src' % id))
|
||||
|
||||
with closing(br.open('http://ebooks.eharlequin.com/' + id.strip(), timeout=timeout/4)) as nf:
|
||||
idata = html.fromstring(nf.read())
|
||||
drm = None
|
||||
if idata.xpath('boolean(//div[@class="drm_head"])'):
|
||||
drm = idata.xpath('boolean(//td[contains(., "Copy") and contains(., "not")])')
|
||||
|
||||
counter -= 1
|
||||
|
||||
s = SearchResult()
|
||||
@ -76,5 +82,6 @@ class EHarlequinStore(BasicStoreConfig, StorePlugin):
|
||||
s.author = author.strip()
|
||||
s.price = price.strip()
|
||||
s.detail_item = '?url=http://ebooks.eharlequin.com/' + id.strip()
|
||||
s.drm = drm
|
||||
|
||||
yield s
|
||||
|
@ -314,7 +314,6 @@ class SearchThread(Thread):
|
||||
self.tasks.task_done()
|
||||
except:
|
||||
traceback.print_exc()
|
||||
pass
|
||||
|
||||
def _clean_query(self, query):
|
||||
query = query.lower()
|
||||
|
Loading…
x
Reference in New Issue
Block a user