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,13 +68,20 @@ class EHarlequinStore(BasicStoreConfig, StorePlugin):
|
|||||||
price = ''.join(data.xpath('.//div[@class="ourprice"]/font/text()'))
|
price = ''.join(data.xpath('.//div[@class="ourprice"]/font/text()'))
|
||||||
cover_url = ''.join(data.xpath('.//a[@href="%s"]/img/@src' % id))
|
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
|
counter -= 1
|
||||||
|
|
||||||
s = SearchResult()
|
s = SearchResult()
|
||||||
s.cover_url = cover_url
|
s.cover_url = cover_url
|
||||||
s.title = title.strip()
|
s.title = title.strip()
|
||||||
s.author = author.strip()
|
s.author = author.strip()
|
||||||
s.price = price.strip()
|
s.price = price.strip()
|
||||||
s.detail_item = '?url=http://ebooks.eharlequin.com/' + id.strip()
|
s.detail_item = '?url=http://ebooks.eharlequin.com/' + id.strip()
|
||||||
|
s.drm = drm
|
||||||
|
|
||||||
yield s
|
yield s
|
||||||
|
@ -314,7 +314,6 @@ class SearchThread(Thread):
|
|||||||
self.tasks.task_done()
|
self.tasks.task_done()
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
pass
|
|
||||||
|
|
||||||
def _clean_query(self, query):
|
def _clean_query(self, query):
|
||||||
query = query.lower()
|
query = query.lower()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user