mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-23 07:43:46 +02:00
add DRM detection to Gandalf store
This commit is contained in:
parent
6a3ad1d22f
commit
4d1dc4fe05
1 changed files with 5 additions and 1 deletions
|
|
@ -62,6 +62,7 @@ def search(self, query, max_results=10, timeout=60):
|
|||
price = ''.join(data.xpath('.//h3[@class="promocja"]/text()'))
|
||||
price = re.sub('PLN', 'zł', price)
|
||||
price = re.sub('\.', ',', price)
|
||||
drm = data.xpath('boolean(.//div[@class="info" and contains(., "Zabezpieczenie: DRM")])')
|
||||
|
||||
counter -= 1
|
||||
|
||||
|
|
@ -71,7 +72,10 @@ def search(self, query, max_results=10, timeout=60):
|
|||
s.author = author.strip()
|
||||
s.price = price
|
||||
s.detail_item = id.strip()
|
||||
s.drm = SearchResult.DRM_UNKNOWN
|
||||
if drm:
|
||||
s.drm = SearchResult.DRM_LOCKED
|
||||
else:
|
||||
s.drm = SearchResult.DRM_UNLOCKED
|
||||
s.formats = formats.upper().strip()
|
||||
|
||||
yield s
|
||||
|
|
|
|||
Loading…
Reference in a new issue