mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge changes from lp:~tomek3d/calibre/store.
This commit is contained in:
commit
1e14274564
@ -1508,6 +1508,7 @@ class StoreVirtualoStore(StoreBase):
|
|||||||
|
|
||||||
headquarters = 'PL'
|
headquarters = 'PL'
|
||||||
formats = ['EPUB', 'MOBI', 'PDF']
|
formats = ['EPUB', 'MOBI', 'PDF']
|
||||||
|
affiliate = True
|
||||||
|
|
||||||
class StoreWaterstonesUKStore(StoreBase):
|
class StoreWaterstonesUKStore(StoreBase):
|
||||||
name = 'Waterstones UK'
|
name = 'Waterstones UK'
|
||||||
|
@ -24,10 +24,12 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog
|
|||||||
class VirtualoStore(BasicStoreConfig, StorePlugin):
|
class VirtualoStore(BasicStoreConfig, StorePlugin):
|
||||||
|
|
||||||
def open(self, parent=None, detail_item=None, external=False):
|
def open(self, parent=None, detail_item=None, external=False):
|
||||||
url = 'http://virtualo.pl/ebook/c2/'
|
pid = '12'
|
||||||
|
url = 'http://virtualo.pl/ebook/c2/?pr=' + pid
|
||||||
|
detail_url = detail_item + '&pr=' + pid if detail_item else url
|
||||||
|
|
||||||
if external or self.config.get('open_external', False):
|
if external or self.config.get('open_external', False):
|
||||||
open_url(QUrl(url_slash_cleaner(detail_item if detail_item else url)))
|
open_url(QUrl(url_slash_cleaner(detail_url)))
|
||||||
else:
|
else:
|
||||||
d = WebStoreDialog(self.gui, url, parent, detail_item)
|
d = WebStoreDialog(self.gui, url, parent, detail_item)
|
||||||
d.setWindowTitle(self.name)
|
d.setWindowTitle(self.name)
|
||||||
@ -54,11 +56,13 @@ class VirtualoStore(BasicStoreConfig, StorePlugin):
|
|||||||
price = ''.join(data.xpath('.//span[@class="price"]/text() | .//span[@class="price abbr"]/text()'))
|
price = ''.join(data.xpath('.//span[@class="price"]/text() | .//span[@class="price abbr"]/text()'))
|
||||||
cover_url = ''.join(data.xpath('.//table/tr[1]/td[1]/a/img/@src'))
|
cover_url = ''.join(data.xpath('.//table/tr[1]/td[1]/a/img/@src'))
|
||||||
title = ''.join(data.xpath('.//div[@class="title"]/a/text()'))
|
title = ''.join(data.xpath('.//div[@class="title"]/a/text()'))
|
||||||
|
title = re.sub(r'\ WM', '', title)
|
||||||
author = ', '.join(data.xpath('.//div[@class="authors"]/a/text()'))
|
author = ', '.join(data.xpath('.//div[@class="authors"]/a/text()'))
|
||||||
formats = ', '.join(data.xpath('.//span[@class="format"]/a/text()'))
|
formats = ', '.join(data.xpath('.//span[@class="format"]/a/text()'))
|
||||||
formats = re.sub(r'(, )?ONLINE(, )?', '', formats)
|
formats = re.sub(r'(, )?ONLINE(, )?', '', formats)
|
||||||
drm = drm_pattern.search(formats)
|
drm = drm_pattern.search(formats)
|
||||||
formats = re.sub(r'(, )?ADE(, )?', '', formats)
|
formats = re.sub(r'(, )?ADE(, )?', '', formats)
|
||||||
|
formats = re.sub(r'\ WM', '', formats)
|
||||||
|
|
||||||
counter -= 1
|
counter -= 1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user