mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
ManyBooks get cover_url
This commit is contained in:
parent
8ccfab537c
commit
5d92612f2e
@ -57,10 +57,19 @@ class ManyBooksStore(StorePlugin):
|
|||||||
author = author.split('-')[0]
|
author = author.split('-')[0]
|
||||||
price = '$0.00'
|
price = '$0.00'
|
||||||
|
|
||||||
|
cover_url = ''
|
||||||
|
with closing(br.open('http://manybooks.net/titles/%s' % id.strip(), timeout=timeout)) as f_i:
|
||||||
|
doc_i = html.fromstring(f_i.read())
|
||||||
|
for img in doc_i.xpath('//img'):
|
||||||
|
src = img.get('src', None)
|
||||||
|
if src and src.endswith('-thumb.jpg'):
|
||||||
|
cover_url = src
|
||||||
|
print cover_url
|
||||||
|
|
||||||
counter -= 1
|
counter -= 1
|
||||||
|
|
||||||
s = SearchResult()
|
s = SearchResult()
|
||||||
s.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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user