mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Get books: fix price lookup for legimi
This commit is contained in:
parent
340401a8c8
commit
cbd75236c6
@ -1,10 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
store_version = 10 # Needed for dynamic plugin loading
|
store_version = 11 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011-2023, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from base64 import b64encode
|
from base64 import b64encode
|
||||||
@ -91,6 +91,6 @@ class LegimiStore(BasicStoreConfig, StorePlugin):
|
|||||||
with closing(br.open(search_result.detail_item, timeout=timeout/2)) as nf:
|
with closing(br.open(search_result.detail_item, timeout=timeout/2)) as nf:
|
||||||
idata = html.fromstring(nf.read())
|
idata = html.fromstring(nf.read())
|
||||||
|
|
||||||
price = ''.join(idata.xpath('.//section[@class="book-sale-options"]//p[@class="light-text"]/text()'))
|
price = ''.join(idata.xpath('.//section[@class="book-sale-options"]//li[@data-test="ebook-retail-option"]//p[@class="light-text"]/text()'))
|
||||||
search_result.price = price.split('bez abonamentu ')[-1]
|
search_result.price = price.split('bez abonamentu ')[-1]
|
||||||
return True
|
return True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user