diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index 3e91bc2ef3..14e0a564db 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -1460,7 +1460,7 @@ class StoreNextoStore(StoreBase): actual_plugin = 'calibre.gui2.store.stores.nexto_plugin:NextoStore' headquarters = 'PL' - formats = ['EPUB', 'PDF'] + formats = ['EPUB', 'MOBI', 'PDF'] affiliate = True class StoreOpenBooksStore(StoreBase): diff --git a/src/calibre/gui2/store/stores/ebookpoint_plugin.py b/src/calibre/gui2/store/stores/ebookpoint_plugin.py index 19b2e0a428..94e6cc73ca 100644 --- a/src/calibre/gui2/store/stores/ebookpoint_plugin.py +++ b/src/calibre/gui2/store/stores/ebookpoint_plugin.py @@ -3,7 +3,7 @@ from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL 3' -__copyright__ = '2011, Tomasz Długosz ' +__copyright__ = '2011-2012, Tomasz Długosz ' __docformat__ = 'restructuredtext en' import re @@ -64,9 +64,7 @@ class EbookpointStore(BasicStoreConfig, StorePlugin): author = ''.join(data.xpath('.//p[@class="author"]/text()')) price = ''.join(data.xpath('.//p[@class="price"]/ins/text()')) - with closing(br.open(id.strip(), timeout=timeout)) as nf: - idata = html.fromstring(nf.read()) - formats = ', '.join(idata.xpath('//dd[@class="radio-line"]/label/text()')) + formats = ', '.join(data.xpath('.//div[@class="ikony"]/span/text()')) counter -= 1 @@ -77,6 +75,6 @@ class EbookpointStore(BasicStoreConfig, StorePlugin): s.price = re.sub(r'\.',',',price) s.detail_item = id.strip() s.drm = SearchResult.DRM_UNLOCKED - s.formats = formats.upper().strip() + s.formats = formats.upper() yield s diff --git a/src/calibre/gui2/store/stores/nexto_plugin.py b/src/calibre/gui2/store/stores/nexto_plugin.py index f7572e6522..79cb1be2f1 100644 --- a/src/calibre/gui2/store/stores/nexto_plugin.py +++ b/src/calibre/gui2/store/stores/nexto_plugin.py @@ -68,8 +68,8 @@ class NextoStore(BasicStoreConfig, StorePlugin): title = ''.join(data.xpath('.//a[@class="title"]/text()')) title = re.sub(r' - ebook$', '', title) formats = ', '.join(data.xpath('.//ul[@class="formats_available"]/li//b/text()')) - DrmFree = re.search(r'bez.DRM', formats) - formats = re.sub(r'\(.+\)', '', formats) + DrmFree = re.search(r'znak', formats) + formats = re.sub(r'\ ?\(.+?\)', '', formats) author = '' with closing(br.open('http://www.nexto.pl/' + id.strip(), timeout=timeout/4)) as nf: diff --git a/src/calibre/gui2/store/stores/woblink_plugin.py b/src/calibre/gui2/store/stores/woblink_plugin.py index d74fb00fef..1dc863700a 100644 --- a/src/calibre/gui2/store/stores/woblink_plugin.py +++ b/src/calibre/gui2/store/stores/woblink_plugin.py @@ -6,6 +6,7 @@ __license__ = 'GPL 3' __copyright__ = '2011-2012, Tomasz Długosz ' __docformat__ = 'restructuredtext en' +import copy import re import urllib from contextlib import closing @@ -66,13 +67,6 @@ class WoblinkStore(BasicStoreConfig, StorePlugin): price = ''.join(data.xpath('.//div[@class="prices"]/span[1]/span/text()')) price = re.sub('\.', ',', price) formats = [ form[8:-4].split('_')[0] for form in data.xpath('.//p[3]/img/@src')] - if 'epub' in formats: - formats.remove('epub') - formats.append('WOBLINK') - if 'E Ink' in data.xpath('.//div[@class="prices"]/img/@title'): - formats.insert(0, 'EPUB') - if 'pdf' in formats: - formats[formats.index('pdf')] = 'PDF' s = SearchResult() s.cover_url = 'http://woblink.com' + cover_url @@ -83,31 +77,25 @@ class WoblinkStore(BasicStoreConfig, StorePlugin): # MOBI should be send first, if 'MOBI' in formats: - s = SearchResult() - s.cover_url = 'http://woblink.com' + cover_url - s.title = title.strip() - s.author = author.strip() - s.price = price + ' zł' - s.detail_item = id.strip() - - s.drm = SearchResult.DRM_UNLOCKED - s.formats = 'MOBI' + t = copy.copy(s) + t.title += ' MOBI' + t.drm = SearchResult.DRM_UNLOCKED + t.formats = 'MOBI' formats.remove('MOBI') counter -= 1 - yield s + yield t # and the remaining formats (if any) next if formats: - s = SearchResult() - s.cover_url = 'http://woblink.com' + cover_url - s.title = title.strip() - s.author = author.strip() - s.price = price + ' zł' - s.detail_item = id.strip() + if 'epub' in formats: + formats.remove('epub') + formats.append('WOBLINK') + if 'E Ink' in data.xpath('.//div[@class="prices"]/img/@title'): + formats.insert(0, 'EPUB') s.drm = SearchResult.DRM_LOCKED - s.formats = ', '.join(formats) + s.formats = ', '.join(formats).upper() counter -= 1 yield s