mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Get books: update empik store
This commit is contained in:
parent
091298f90e
commit
55c4b16e6d
@ -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 = 9 # Needed for dynamic plugin loading
|
store_version = 10 # 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
|
||||||
@ -68,13 +68,13 @@ class EmpikStore(BasicStoreConfig, StorePlugin):
|
|||||||
if counter <= 0:
|
if counter <= 0:
|
||||||
break
|
break
|
||||||
|
|
||||||
id = ''.join(data.xpath('.//div[@class="name"]/a/@href'))
|
id = ''.join(data.xpath('.//a[@class="img seoImage"]/@href'))
|
||||||
if not id:
|
if not id:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
cover_url = ''.join(data.xpath('.//a/img[@class="lazy"]/@lazy-img'))
|
title = ''.join(data.xpath('.//h2[@class="product-title"]/a/strong/text()'))
|
||||||
author = ', '.join(data.xpath('.//a[@class="smartAuthor "]/text()'))
|
author = ', '.join(data.xpath('.//a[@class="smartAuthor "]/text()'))
|
||||||
title = ''.join(data.xpath('.//div[@class="name"]/a/@title'))
|
cover_url = ''.join(data.xpath('.//a/img[@class="lazy"]/@lazy-img'))
|
||||||
price = ''.join(data.xpath('.//div[@class="price ta-price-tile "]/text()'))
|
price = ''.join(data.xpath('.//div[@class="price ta-price-tile "]/text()'))
|
||||||
|
|
||||||
# with closing(br.open('https://empik.com' + id.strip(), timeout=timeout/4)) as nf:
|
# with closing(br.open('https://empik.com' + id.strip(), timeout=timeout/4)) as nf:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user