mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Fix Project Gutenberg store plugin
This commit is contained in:
parent
519ee771b0
commit
d592239132
@ -45,7 +45,7 @@ class GutenbergStore(BasicStoreConfig, StorePlugin):
|
||||
counter = max_results
|
||||
with closing(br.open(url, timeout=timeout)) as f:
|
||||
doc = html.fromstring(f.read())
|
||||
for data in doc.xpath('//ol[@class="results"]//li[contains(@class, "icon_title")]'):
|
||||
for data in doc.xpath('//ol[@class="results"]//li[@class="entry data icon_title"]'):
|
||||
if counter <= 0:
|
||||
break
|
||||
|
||||
@ -55,6 +55,9 @@ class GutenbergStore(BasicStoreConfig, StorePlugin):
|
||||
title = ''.join(data.xpath('.//span[@class="title"]/text()'))
|
||||
author = ''.join(data.xpath('.//span[@class="subtitle"]/text()'))
|
||||
|
||||
if title.lower().find(query.lower()) == -1 and author.lower().find(query.lower()) == -1:
|
||||
continue
|
||||
|
||||
counter -= 1
|
||||
|
||||
s = SearchResult()
|
||||
|
Loading…
x
Reference in New Issue
Block a user