diff --git a/src/calibre/customize/builtins.py b/src/calibre/customize/builtins.py index 9d93d1e26a..d54527bea5 100644 --- a/src/calibre/customize/builtins.py +++ b/src/calibre/customize/builtins.py @@ -1476,6 +1476,7 @@ class StoreKoobeStore(StoreBase): drm_free_only = True headquarters = 'PL' formats = ['EPUB', 'MOBI', 'PDF'] + affiliate = True class StoreLegimiStore(StoreBase): name = 'Legimi' diff --git a/src/calibre/gui2/store/stores/koobe_plugin.py b/src/calibre/gui2/store/stores/koobe_plugin.py index 101a87bc6f..12f1905bfe 100644 --- a/src/calibre/gui2/store/stores/koobe_plugin.py +++ b/src/calibre/gui2/store/stores/koobe_plugin.py @@ -9,6 +9,7 @@ __docformat__ = 'restructuredtext en' import re import urllib +from base64 import b64encode from contextlib import closing from lxml import html @@ -25,12 +26,19 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog class KoobeStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): + aff_root = 'https://www.a4b-tracking.com/pl/stat-click-text-link/15/58/' url = 'http://www.koobe.pl/' + aff_url = aff_root + str(b64encode(url)) + + detail_url = None + if detail_item: + detail_url = aff_root + str(b64encode(detail_item)) + if external or self.config.get('open_external', False): - open_url(QUrl(url_slash_cleaner(detail_item))) + open_url(QUrl(url_slash_cleaner(detail_url if detail_url else aff_url))) else: - d = WebStoreDialog(self.gui, url, parent, detail_item) + d = WebStoreDialog(self.gui, url, parent, detail_url) d.setWindowTitle(self.name) d.set_tags(self.config.get('tags', '')) d.exec_()