diff --git a/src/calibre/gui2/store/stores/publio_plugin.py b/src/calibre/gui2/store/stores/publio_plugin.py index 2b0e9b7d41..c60c34200b 100644 --- a/src/calibre/gui2/store/stores/publio_plugin.py +++ b/src/calibre/gui2/store/stores/publio_plugin.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*- from __future__ import (unicode_literals, division, absolute_import, print_function) -store_version = 7 # Needed for dynamic plugin loading +store_version = 8 # Needed for dynamic plugin loading __license__ = 'GPL 3' __copyright__ = '2012-2017, Tomasz Długosz ' __docformat__ = 'restructuredtext en' import urllib +from base64 import b64encode from contextlib import closing from lxml import html @@ -25,13 +26,19 @@ from calibre.gui2.store.web_store_dialog import WebStoreDialog class PublioStore(BasicStoreConfig, StorePlugin): def open(self, parent=None, detail_item=None, external=False): - google_analytics = '?utm_source=tdcalibre&utm_medium=calibre' - url = 'http://www.publio.pl/' + google_analytics + aff_root = 'https://www.a4b-tracking.com/pl/stat-click-text-link/29/58/' + url = 'http://www.publio.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 + google_analytics) if detail_item else url))) + open_url(QUrl(url_slash_cleaner(detail_url if detail_url else aff_url))) else: - d = WebStoreDialog(self.gui, url, parent, detail_item if detail_item else url) + d = WebStoreDialog(self.gui, url, parent, detail_url if detail_url else aff_url) d.setWindowTitle(self.name) d.set_tags(self.config.get('tags', '')) d.exec_()