This commit is contained in:
Kovid Goyal 2023-08-04 07:28:35 +05:30
commit d3d634e4f5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 18 additions and 18 deletions

View File

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
store_version = 8 # Needed for dynamic plugin loading
store_version = 9 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011-2016, Tomasz Długosz <tomek3d@gmail.com>'
__copyright__ = '2011-2023, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en'
import re
@ -75,8 +75,8 @@ class EbookpointStore(BasicStoreConfig, StorePlugin):
continue
formats = ', '.join(data.xpath('.//ul[@class="book-type book-type-points"]//span[@class="popup"]/span/text()'))
cover_url = ''.join(data.xpath('.//p[@class="cover"]/img/@data-src'))
title = ''.join(data.xpath('.//div[@class="book-info"]/h3/a/text()'))
cover_url = ''.join(data.xpath('.//p[@class="cover "]/img/@data-src'))
title = ''.join(data.xpath('.//div[@class="book-info"]/h3/a[1]/text()'))
author = ''.join(data.xpath('.//p[@class="author"]//text()'))
price = ''.join(data.xpath('.//p[@class="price price-incart"]/a/ins/text()|.//p[@class="price price-add"]/a/text()'))

View File

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
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'
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
__copyright__ = '2011-2023, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en'
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:
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]
return True

View File

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
store_version = 6 # Needed for dynamic plugin loading
store_version = 7 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011-2020, Tomasz Długosz <tomek3d@gmail.com>'
__copyright__ = '2011-2023, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en'
import re
@ -81,9 +81,9 @@ class NextoStore(BasicStoreConfig, StorePlugin):
price = ''.join(data.xpath('.//strong[@class="nprice"]/text()'))
cover_url = ''.join(data.xpath('.//img[@class="cover"]/@src'))
cover_url = ''.join(data.xpath('.//picture[@class="cover"]/img/@data-src'))
cover_url = re.sub(r'%2F', '/', cover_url)
cover_url = re.sub(r'widthMax=120&heightMax=200', 'widthMax=64&heightMax=64', cover_url)
cover_url = re.sub(r'widthMax=235&heightMax=335', 'widthMax=64&heightMax=64', cover_url)
title = ''.join(data.xpath('.//a[@class="title"]/text()'))
title = re.sub(r' ebook', '', title)
author = ', '.join(data.xpath('.//div[@class="col-7"]//h4//a/text()'))

View File

@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
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'
__copyright__ = '2011-2019, Tomasz Długosz <tomek3d@gmail.com>'
__copyright__ = '2011-2023, Tomasz Długosz <tomek3d@gmail.com>'
__docformat__ = 'restructuredtext en'
import re
@ -41,7 +41,7 @@ class VirtualoStore(BasicStoreConfig, StorePlugin):
def open(self, parent=None, detail_item=None, external=False):
aff_root = 'https://www.a4b-tracking.com/pl/stat-click-text-link/12/58/'
url = 'http://virtualo.pl/ebook/c2/'
url = 'http://virtualo.pl/ebooki/'
aff_url = aff_root + as_base64(url)
@ -58,7 +58,7 @@ class VirtualoStore(BasicStoreConfig, StorePlugin):
d.exec()
def search(self, query, max_results=12, timeout=60):
url = 'http://virtualo.pl/?q=' + quote(query)
url = 'http://virtualo.pl/?cat=1&q=' + quote(query)
br = browser()
no_drm_pattern = re.compile(r'Watermark|brak')
@ -66,7 +66,7 @@ class VirtualoStore(BasicStoreConfig, StorePlugin):
counter = max_results
with closing(br.open(url, timeout=timeout)) as f:
doc = html.fromstring(f.read())
for data in doc.xpath('//div[@class="products-list-wrapper"]//li[@class="product "]'):
for data in doc.xpath('//div[@class="products-list-wrapper"]//li[@class="product"]'):
if counter <= 0:
break
@ -74,10 +74,10 @@ class VirtualoStore(BasicStoreConfig, StorePlugin):
if not id:
continue
price = ''.join(data.xpath('.//div[@class="information"]//div[@class="price"]/text()'))
price = ''.join(data.xpath('.//div[@class="info"]//div[@class="price"]/text()'))
cover_url = ''.join(data.xpath('.//img[@class="cover"]/@src'))
title = ''.join(data.xpath('.//h3[@class="title"]/a//text()'))
author = ', '.join(data.xpath('.//div[@class="information"]//div[@class="authors"]/a//text()'))
author = ', '.join(data.xpath('.//div[@class="info"]//div[@class="authors"]/a//text()'))
formats = [form.strip() for form in data.xpath('.//div[@class="text-wrapper"]//div[@class="format"]/span[@class="prompt_preview"]/text()')]
nodrm = no_drm_pattern.search(''.join(data.xpath('.//div[@class="protection"]/text()')))