Nexto store: remove use of type('') with better xpath

There's no need to run regular expressions on a str(list()) of lxml
element results, to see if anything contains a string -- simply use the
XPath grammar contains() and check if any results were returned.
This commit is contained in:
Eli Schwartz 2019-09-23 19:01:03 -04:00
parent 448b412c9d
commit 26871566ce
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -76,7 +76,7 @@ class NextoStore(BasicStoreConfig, StorePlugin):
title = re.sub(r' ebook', '', title)
author = ', '.join(data.xpath('.//div[@class="col-7"]//h4//a/text()'))
formats = ', '.join(data.xpath('.//ul[@class="formats"]/li//b/text()'))
DrmFree = re.search(r'znak', type('')(data.xpath('.//ul[@class="formats"]/li//b/@title')))
DrmFree = data.xpath('.//ul[@class="formats"]/li//b[contains(@title, "znak")]')
counter -= 1